In actual project development, we often need to monitor the project build file, and automatically reconstruct a new output file when the source code of the project changes.
The configuration code is as follows:
webpack.config.js
module.export = {
watch:true,
watchOption:{
ignored:/ node_modules / // Ignore files that do not need to be monitored
aggregationTimeout: 300,
poll: 1000 // The default access is 1000 per second
}
}
在执行时候的命令 带上参数--watch 如 webpack--watch