-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.watch.config.js
More file actions
39 lines (32 loc) · 1.02 KB
/
webpack.watch.config.js
File metadata and controls
39 lines (32 loc) · 1.02 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
'use strict';
const webpack = require ('webpack');
const config = require('./webpack.config.js');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const CleanObsoleteChunks = require('webpack-clean-obsolete-chunks');
const styleLintPlugin = require('./webpack/linters/stylelint');
const rules = require('./webpack/rules');
const watchRules = rules({
dirname: __dirname
});
module.exports = Object.assign({}, config, {
watch: true,
watchOptions: {
aggregateTimeout: 300,
pull: 1000
},
devtool: 'source-map',
plugins: config.plugins.concat([
new CleanObsoleteChunks(),
new ProgressBarPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
minChunks: function(module) {
return module.context && module.context.includes('node_modules');
}
}),
styleLintPlugin
]),
module: Object.assign({}, config.module, {
rules: config.module.rules.concat(watchRules)
})
});