Accélération de la compilation Webpack en dev
parent
a1207883b1
commit
92f37cd5ce
|
@ -83,6 +83,7 @@
|
|||
"fantasy-land": "^3.3.0",
|
||||
"fantasy-tuples": "^1.0.0",
|
||||
"file-loader": "^1.1.6",
|
||||
"hard-source-webpack-plugin": "^0.5.18",
|
||||
"html-loader": "^0.5.1",
|
||||
"img-loader": "^2.0.0",
|
||||
"jsdom": "^11.0.0",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
var webpack = require('webpack'),
|
||||
path = require('path'),
|
||||
prodEnv = process.env.NODE_ENV == 'production' // eslint-disable-line no-undef
|
||||
prodEnv = process.env.NODE_ENV == 'production', // eslint-disable-line no-undef
|
||||
HardSourceWebpackPlugin = require('hard-source-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
@ -92,6 +93,13 @@ module.exports = {
|
|||
new webpack.EnvironmentPlugin({ NODE_ENV: 'development' }),
|
||||
new webpack.NoEmitOnErrorsPlugin()
|
||||
]
|
||||
.concat(!prodEnv ? [new webpack.HotModuleReplacementPlugin()] : [])
|
||||
.concat(
|
||||
!prodEnv
|
||||
? [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new HardSourceWebpackPlugin()
|
||||
]
|
||||
: []
|
||||
)
|
||||
.concat(prodEnv ? [new webpack.optimize.UglifyJsPlugin()] : [])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue