From f73c4ea9ebe5fc16ea105fdcb6c35ef9cc432204 Mon Sep 17 00:00:00 2001 From: Chunpeng Huo Date: Sat, 7 Sep 2019 11:35:51 +1000 Subject: [PATCH] fix(webpack): avoid unnecessary breaking change on argument With this fix, `au run --analyze` `au run --hmr` will continue to work. --- package-lock.json | 2 +- skeleton/webpack/package.json | 10 +++++----- skeleton/webpack/webpack.config.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7ba84c95..eae4ee790 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aurelia-cli", - "version": "1.0.2", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/skeleton/webpack/package.json b/skeleton/webpack/package.json index e1c5d9994..c5c55f5f9 100644 --- a/skeleton/webpack/package.json +++ b/skeleton/webpack/package.json @@ -71,15 +71,15 @@ "tree-kill": "^1.2.1", }, "scripts": { - "build": "webpack --env.production --env.extractCss", - "build:dev": "webpack --env.extractCss", - "analyze": "webpack --env.production --env.analyze", + "build": "webpack --env.production --extractCss", + "build:dev": "webpack --extractCss", + "analyze": "webpack --env.production --analyze", // @if feat['dotnet-core'] - "start": "webpack-dev-server --env.extractCss" + "start": "webpack-dev-server --extractCss" // @endif // @if feat.web - "start": "webpack-dev-server --env.extractCss" + "start": "webpack-dev-server --extractCss" // @endif } } diff --git a/skeleton/webpack/webpack.config.js b/skeleton/webpack/webpack.config.js index e3377f2c2..2bb3496fe 100644 --- a/skeleton/webpack/webpack.config.js +++ b/skeleton/webpack/webpack.config.js @@ -51,7 +51,7 @@ const sassRules = [ ]; // @endif -module.exports = ({ production, extractCss, analyze, tests, hmr, port, host } = {}) => ({ +module.exports = ({ production } = {}, {extractCss, analyze, tests, hmr, port, host } = {}) => ({ resolve: { // @if feat.typescript extensions: ['.ts', '.js'], @@ -208,7 +208,7 @@ module.exports = ({ production, extractCss, analyze, tests, hmr, port, host } = contentBase: outDir, // serve index.html for all 404 (required for push-state) historyApiFallback: true, - hot: hmr, + hot: hmr || project.platform.hmr, port: port || project.platform.port, host: host || project.platform.host },