File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 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) {
6363 extraPlugins . push ( new ProgressPlugin ( { profile : buildOptions . verbose , colors : true } ) ) ;
6464 }
6565
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+
6675 return {
67- devtool : buildOptions . sourcemaps ? 'source-map' : false ,
6876 resolve : {
6977 extensions : [ '.ts' , '.js' ] ,
7078 modules : [ 'node_modules' , nodeModules ] ,
Original file line number Diff line number Diff line change @@ -151,6 +151,9 @@ class JsonWebpackSerializer {
151151 case ( < any > webpack ) . HashedModuleIdsPlugin :
152152 this . _addImport ( 'webpack' , 'HashedModuleIdsPlugin' ) ;
153153 break ;
154+ case webpack . SourceMapDevToolPlugin :
155+ this . _addImport ( 'webpack' , 'SourceMapDevToolPlugin' ) ;
156+ break ;
154157 case webpack . optimize . UglifyJsPlugin :
155158 this . _addImport ( 'webpack.optimize' , 'UglifyJsPlugin' ) ;
156159 break ;
You can’t perform that action at this time.
0 commit comments