-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrspack.dev.js
More file actions
51 lines (47 loc) · 1.31 KB
/
rspack.dev.js
File metadata and controls
51 lines (47 loc) · 1.31 KB
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
const path = require("path")
const rspack = require("@rspack/core")
const { merge } = require("webpack-merge")
const ReactRefreshPlugin = require("@rspack/plugin-react-refresh")
const common = require("./rspack.common")
const server = require("./rspack.server")
/**
* @param {common.CommonEnv} env
* @returns {rspack.Configuration}
*/
module.exports = (env) => {
/** @type {rspack.Configuration} */
const config = common(merge(server, {
mode: "development",
devServer: {
static: path.resolve(__dirname, "static"),
hot: "only",
client: {
overlay: {
errors: true,
warnings: true,
runtimeErrors: false
}
}
},
output: {
filename: "static/scripts/[name].js"
},
devtool: "eval-source-map",
module: {
rules: [
{
test: /\.css$/,
use: "style-loader",
enforce: "post"
}
]
},
plugins: [
new ReactRefreshPlugin({
exclude: [/[\\\/]node_modules[\\\/]/i, /[\\\/]external-module\.ts$/i],
overlay: false
})
]
}), env)
return config
}