Split webpack dev config into dev and hot

Motivation:

* too many conditionals for config, better to be explicit
* different priorities: faster build for hot mode
* working SCSS sources for styles in hot mode

The biggest differences:

* removed linter from TS loader in hot (should be editor or precommit
 or responsibility)
* simplified styles loading
* hot needs more extensions to resolve
* removed commons chunking for hot
* removed devServer from dev

Reduced HMR time from 8s to 4s on my machine.
This commit is contained in:
David Kaltschmidt
2018-05-28 13:49:15 +02:00
parent 5a96863eed
commit ebe8e62bd5
3 changed files with 106 additions and 67 deletions
+2 -2
View File
@@ -105,7 +105,7 @@
},
"scripts": {
"dev": "webpack --progress --colors --config scripts/webpack/webpack.dev.js",
"start": "webpack-dev-server --progress --colors --config scripts/webpack/webpack.dev.js",
"start": "webpack-dev-server --progress --colors --config scripts/webpack/webpack.hot.js",
"watch": "webpack --progress --colors --watch --config scripts/webpack/webpack.dev.js",
"build": "grunt build",
"test": "grunt test",
@@ -183,4 +183,4 @@
"resolutions": {
"caniuse-db": "1.0.30000772"
}
}
}