Commit 91da0a5 1 parent e986f06 commit 91da0a5 Copy full SHA for 91da0a5
File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,16 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
63
63
extraPlugins . push ( new ProgressPlugin ( { profile : buildOptions . verbose , colors : true } ) ) ;
64
64
}
65
65
66
+ if ( buildOptions . sourcemaps ) {
67
+ extraPlugins . push ( new webpack . SourceMapDevToolPlugin ( {
68
+ filename : '[file].map[query]' ,
69
+ moduleFilenameTemplate : '[resource-path]' ,
70
+ fallbackModuleFilenameTemplate : '[resource-path]?[hash]' ,
71
+ sourceRoot : 'webpack:///'
72
+ } ) ) ;
73
+ }
74
+
66
75
return {
67
- devtool : buildOptions . sourcemaps ? 'source-map' : false ,
68
76
resolve : {
69
77
extensions : [ '.ts' , '.js' ] ,
70
78
modules : [ 'node_modules' , nodeModules ] ,
Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ class JsonWebpackSerializer {
158
158
case ( < any > webpack ) . HashedModuleIdsPlugin :
159
159
this . _addImport ( 'webpack' , 'HashedModuleIdsPlugin' ) ;
160
160
break ;
161
+ case webpack . SourceMapDevToolPlugin :
162
+ this . _addImport ( 'webpack' , 'SourceMapDevToolPlugin' ) ;
163
+ break ;
161
164
case webpack . optimize . UglifyJsPlugin :
162
165
this . _addImport ( 'webpack.optimize' , 'UglifyJsPlugin' ) ;
163
166
break ;
You can’t perform that action at this time.
0 commit comments