diff --git a/package.json b/package.json index 1d21a04a..44d2bce8 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "scripts": { "test": "jest", "tox": "sudo docker exec -it -u root iris_mopidy_1 bash -c \"cd /iris && tox\"", - "start": "NODE_ENV=development webpack-dev-server", + "start": "NODE_ENV=development WEBPACK_DEV_SERVER=1 webpack-dev-server", "lint": "eslint src", "lint:fix": "eslint src --fix", "build": "node build_tools/build.js", diff --git a/webpack.config.js b/webpack.config.js index afa77167..bb77751f 100755 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const isDev = process.env.NODE_ENV !== 'production'; +const isDevServer = process.env.WEBPACK_DEV_SERVER; const path = require('path'); const webpack = require('webpack'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); @@ -90,7 +91,7 @@ const config = { new MiniCssExtractPlugin({ filename: `app${isDev ? '' : '.min'}.css`, }), - new HtmlWebpackPlugin({ template: './src/index.html' }), + ...isDevServer ? [new HtmlWebpackPlugin({ template: './src/index.html' })] : [], ], watchOptions: { poll: true,