diff --git a/config/webpack.config.js b/config/webpack.config.js index a50402a..1fc02d5 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -41,7 +41,14 @@ module.exports = { // serve index.html in place of 404 responses to allow HTML5 history historyApiFallback: true, port: PORT, - host: HOST + host: HOST, + watchOptions: { + // Disabled polling by default as it causes lots of CPU usage and hence drains laptop batteries. To enable polling add WEBPACK_DEV_SERVER_POLLING to your environment + // See for details + poll: (!!process.env.WEBPACK_DEV_SERVER_POLLING ? true : false), + watch: false, + ignored: /node_modules/ + } }, plugins: [ new webpack.NoErrorsPlugin(), diff --git a/package.json b/package.json index 260623b..5b1beb4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "webpack --config config/webpack.production.config.js --progress --profile --colors", "test": "wdio config/wdio.conf.js", "test-watch": "wdio config/wdio.conf.js --watch", - "start": "webpack-dev-server --progress --profile --colors --watch-poll --config config/webpack.config.js", + "start": "webpack-dev-server --progress --profile --colors --config config/webpack.config.js", "lint": "eslint --ext js --ext jsx {src,test}", "lint-styles": "stylelint 'src/styles/*.scss'" },