Skip to content

Commit bd0dac1

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

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
@@ -158,6 +158,9 @@ class JsonWebpackSerializer {
158158
case (<any>webpack).HashedModuleIdsPlugin:
159159
this._addImport('webpack', 'HashedModuleIdsPlugin');
160160
break;
161+
case webpack.SourceMapDevToolPlugin:
162+
this._addImport('webpack', 'SourceMapDevToolPlugin');
163+
break;
161164
case webpack.optimize.UglifyJsPlugin:
162165
this._addImport('webpack.optimize', 'UglifyJsPlugin');
163166
break;

0 commit comments

Comments
 (0)