-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrspack.config.js
70 lines (67 loc) · 1.67 KB
/
rspack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const path = require("path");
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const config = {
entry: {
main: [
"@babel/polyfill",
path.resolve(__dirname, "static/js/components/Main.jsx"),
],
},
output: {
path: path.resolve(__dirname, "static/build"),
publicPath: "/static/build/",
filename: "[name].bundle.js",
chunkFilename: "[name].[chunkHash].bundle.js",
},
module: {
rules: [
{
test: /\.(js|jsx)?$/,
loader: "babel-loader",
exclude: /node_modules/,
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-transform-arrow-functions",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
],
compact: false,
},
},
{
test: /\.css$/,
include: /static\/js/,
use: [
{
loader: "style-loader",
},
{
loader: "css-loader",
options: {
modules: true,
},
},
],
},
],
},
plugins: [
// Uncomment the following line to enable bundle size analysis
// new BundleAnalyzerPlugin()
],
resolve: {
alias: {
baselayer: path.resolve(__dirname, "baselayer/static/js"),
},
extensions: [".js", ".jsx"],
},
watchOptions: {
ignored: /node_modules/,
// Set to true if you have trouble with JS change monitoring
poll: false,
},
mode: "development",
};
module.exports = config;