Only build HTML for WDS, use our custom builder for actual builds

This commit is contained in:
James Barnsley
2022-11-02 21:05:30 +13:00
parent 43734f8991
commit e906177bc1
2 changed files with 3 additions and 2 deletions

View File

@ -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",

View File

@ -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,