generated from trim21/webpack-userscript-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.cjs
42 lines (38 loc) · 987 Bytes
/
webpack.config.dev.cjs
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
const path = require("path");
const { merge } = require("webpack-merge");
const LiveReloadPlugin = require("webpack-livereload-plugin");
const { UserScriptMetaDataPlugin } = require("userscript-metadata-webpack-plugin");
const metadata = require("./metadata.cjs");
const webpackConfig = require("./webpack.config.base.cjs");
metadata.require.push(
"file://" + path.resolve(__dirname, "../dist/index.debug.js")
);
const cfg = merge(webpackConfig, {
mode: "development",
cache: {
type: "filesystem",
name: "dev",
},
entry: {
debug: webpackConfig.entry,
"dev.user": path.resolve(__dirname, "./empty.cjs"),
},
output: {
filename: "index.[name].js",
path: path.resolve(__dirname, "../dist"),
},
devtool: "eval-source-map",
watch: true,
watchOptions: {
ignored: /node_modules/,
},
plugins: [
new LiveReloadPlugin({
delay: 500,
}),
new UserScriptMetaDataPlugin({
metadata,
}),
],
});
module.exports = cfg;