DocSpace-client/packages/login/webpack/webpack.base.js

60 lines
1.4 KiB
JavaScript
Raw Normal View History

const scriptExtensions = /\.(tsx|ts|js|jsx|mjs)$/;
const imageExtensions = /\.(bmp|gif|jpg|jpeg|png)$/;
const fontsExtension = /\.(eot|otf|ttf|woff|woff2)$/;
module.exports = {
resolve: {
extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
fallback: {
crypto: false,
},
},
module: {
rules: [
{
test: scriptExtensions,
exclude: /node_modules/,
use: [
{
loader: "babel-loader",
options: {
2022-08-17 07:24:39 +00:00
presets: [
"@babel/preset-react",
"@babel/preset-env",
"@babel/preset-typescript",
],
plugins: [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
["styled-components", { ssr: true }],
],
},
},
],
},
{
test: fontsExtension,
type: "asset",
},
{
2022-08-12 19:34:28 +00:00
test: /\.react.svg$/,
use: [
{
loader: "@svgr/webpack",
options: {
svgoConfig: {
plugins: [{ removeViewBox: false }],
},
},
},
],
},
{
test: imageExtensions,
type: "asset/resource",
},
],
},
};