-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
52 lines (51 loc) · 1.73 KB
/
webpack.dev.js
File metadata and controls
52 lines (51 loc) · 1.73 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
52
let baseConfig = require('./webpack.config');
let webpack = require('webpack');
let CompressionPlugin = require("compression-webpack-plugin");
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
let ManifestPlugin = require('webpack-manifest-plugin');
// let CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = Object.assign({}, baseConfig, {
watch: true,
plugins: [
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]),
new CompressionPlugin({
asset: "[path].gz[query]",
algorithm: "gzip",
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8
}),
new webpack.ProvidePlugin({
"React": "react",
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development')
}
}),
// new BundleAnalyzerPlugin({
// analyzerMode: 'static'
// }),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'lib.js',
minChunks(module, count) {
var context = module.context;
return context && context.indexOf('node_modules') >= 0;
},
}),
new ManifestPlugin({
fileName: 'manifest.json',
basePath: '/build/',
cache: {
"name": "DevMap",
"short_name": "DevMap",
"start_url": ".",
"display": "standalone",
"background_color": "#fff",
"description": "Maintain a mind map"
}
})
]
});