From 92f37cd5cef9c45c4ce3a59990aecefaa527ba2a Mon Sep 17 00:00:00 2001 From: mama Date: Wed, 14 Feb 2018 16:01:37 +0100 Subject: [PATCH] =?UTF-8?q?Acc=C3=A9l=C3=A9ration=20de=20la=20compilation?= =?UTF-8?q?=20Webpack=20en=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + source/webpack.config.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 28048110f..f7e9b9dbc 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/source/webpack.config.js b/source/webpack.config.js index f41eaec89..ff375db7b 100644 --- a/source/webpack.config.js +++ b/source/webpack.config.js @@ -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()] : []) }