Speed up development builds slightly

This commit is contained in:
Travis Ralston 2018-12-22 19:00:43 -07:00
parent 32a639ef95
commit 83d7b7a7f8
4 changed files with 1053 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.awcache/
.idea/
node_modules/
web-dist/

1032
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -61,6 +61,8 @@
"@angular/router": "^5.2.11",
"@angularclass/hmr": "^2.1.0",
"@angularclass/hmr-loader": "^3.0.2",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"@fortawesome/fontawesome": "^1.1.8",
"@fortawesome/fontawesome-free-brands": "^5.0.13",
"@fortawesome/fontawesome-free-regular": "^5.0.13",

View File

@ -8,7 +8,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const isProd = process.env.npm_lifecycle_event.startsWith('build');
module.exports = function () {
var config = {};
const config = {};
if (isProd) config.devtool = 'source-map';
else config.devtool = 'eval-source-map';
@ -34,7 +34,20 @@ module.exports = function () {
rules: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader', '@angularclass/hmr-loader'],
loaders: [{
loader: 'awesome-typescript-loader',
options: {
useCache: true,
useBabel: true,
babelOptions: {
babelrc: false,
presets: [
["@babel/preset-env", {"targets": "last 2 versions, ie 11", "modules": false}]
],
},
babelCore: "@babel/core",
},
}, 'angular2-template-loader', '@angularclass/hmr-loader'],
exclude: [/node_modules\/(?!(ng2-.+))/]
},
{
@ -110,10 +123,6 @@ module.exports = function () {
new HtmlWebpackPlugin({
template: './web/public/index.html',
chunksSortMode: 'dependency'
}),
new MiniCssExtractPlugin({
filename: 'css/[name].[hash].css',
disable: !isProd
})
];
@ -123,6 +132,11 @@ module.exports = function () {
from: root('web/public')
}])
);
config.plugins.push(
new MiniCssExtractPlugin({
filename: 'css/[name].[hash].css',
})
);
}
config.devServer = {