-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.webpack.config.cjs
32 lines (30 loc) · 1.06 KB
/
dev.webpack.config.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
const exec = require('child_process').exec;
const { merge } = require('webpack-merge')
const prod = require('./webpack.config.cjs')
module.exports = merge(prod, {
mode: "development",
devtool: "inline-source-map",
watch: true,
watchOptions: {
ignored: ["node_modules", "dist"],
aggregateTimeout: 600,
},
plugins: [
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
exec('./assemble.sh', (err, stdout, stderr) => {
if (stdout) process.stdout.write(stdout);
if (stderr) process.stderr.write(stderr);
});
});
/*compiler.hooks.beforeCompile.tap("BeforeCompilePlugin", () => {
exec('rm -rf dist', (err, stdout, stderr) => {
if (stdout) process.stdout.write(stdout);
if (stderr) process.stderr.write(stderr);
});
})*/
}
}
]
})