Skip to content

Commit cf66e6b

Browse files
Charles LydingBrocco
Charles Lyding
authored andcommitted
fix(@angular/cli): correct sourcemap source paths
1 parent dbb7d6d commit cf66e6b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/@angular/cli/models/webpack-configs/common.ts

+9-1
Original file line numberDiff line numberDiff 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],

packages/@angular/cli/tasks/eject.ts

+3
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)