Skip to content

Commit 6ba4b82

Browse files
committed
chore: Update WebPack Config to match breaking changes
1 parent 94ef6ad commit 6ba4b82

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

config/webpack/webpack.dev.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ const webpack = require('webpack');
22
const path = require('path');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
44
const DashboardPlugin = require('webpack-dashboard/plugin');
5+
const nodeEnv = process.env.NODE_ENV || 'development';
6+
const isProd = nodeEnv === 'production';
57

68
var config = {
7-
devtool: 'cheap-eval-source-map',
9+
devtool: isProd ? 'hidden-source-map' : 'cheap-eval-source-map',
810
context: path.resolve('./src'),
911
entry: {
1012
app: './index.ts',
@@ -19,8 +21,8 @@ var config = {
1921
}
2022
},
2123
module: {
22-
loaders: [
23-
{ test: /\.ts$/, exclude: ["node_modules"], loader: 'ts-loader' },
24+
rules: [
25+
{ enforce: 'pre',test: /\.ts$/, exclude: ["node_modules"], loader: 'ts-loader' },
2426
{ test: /\.html$/, loader: "html" },
2527
{ test: /\.css$/, loaders: ['style', 'css'] }
2628
]
@@ -40,16 +42,12 @@ var config = {
4042
filename: 'vendor.bundle.js'
4143
}),
4244
new webpack.optimize.UglifyJsPlugin({
43-
compress: {warnings: false},
44-
output: {comments: false},
45+
compress: { warnings: false },
46+
output: { comments: false },
4547
sourceMap: false
4648
}),
47-
new DashboardPlugin()
48-
],
49-
// tslint: {
50-
// emitErrors: false,
51-
// failOnHint: false
52-
// },
49+
new DashboardPlugin()
50+
]
5351
};
5452

5553
module.exports = config;

0 commit comments

Comments
 (0)