@@ -2,9 +2,11 @@ const webpack = require('webpack');
2
2
const path = require ( 'path' ) ;
3
3
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
4
4
const DashboardPlugin = require ( 'webpack-dashboard/plugin' ) ;
5
+ const nodeEnv = process . env . NODE_ENV || 'development' ;
6
+ const isProd = nodeEnv === 'production' ;
5
7
6
8
var config = {
7
- devtool : 'cheap-eval-source-map' ,
9
+ devtool : isProd ? 'hidden-source-map' : 'cheap-eval-source-map' ,
8
10
context : path . resolve ( './src' ) ,
9
11
entry : {
10
12
app : './index.ts' ,
@@ -19,8 +21,8 @@ var config = {
19
21
}
20
22
} ,
21
23
module : {
22
- loaders : [
23
- { test : / \. t s $ / , exclude : [ "node_modules" ] , loader : 'ts-loader' } ,
24
+ rules : [
25
+ { enforce : 'pre' , test : / \. t s $ / , exclude : [ "node_modules" ] , loader : 'ts-loader' } ,
24
26
{ test : / \. h t m l $ / , loader : "html" } ,
25
27
{ test : / \. c s s $ / , loaders : [ 'style' , 'css' ] }
26
28
]
@@ -40,16 +42,12 @@ var config = {
40
42
filename : 'vendor.bundle.js'
41
43
} ) ,
42
44
new webpack . optimize . UglifyJsPlugin ( {
43
- compress : { warnings : false } ,
44
- output : { comments : false } ,
45
+ compress : { warnings : false } ,
46
+ output : { comments : false } ,
45
47
sourceMap : false
46
48
} ) ,
47
- new DashboardPlugin ( )
48
- ] ,
49
- // tslint: {
50
- // emitErrors: false,
51
- // failOnHint: false
52
- // },
49
+ new DashboardPlugin ( )
50
+ ]
53
51
} ;
54
52
55
53
module . exports = config ;
0 commit comments