Skip to content

Commit 32e5ff9

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular-devkit/build-angular): fix sourcemaps paths
`output.devtoolModuleFilenameTemplate` is not used when `SourceMapDevToolPlugin` https://github.com/webpack/webpack/blob/671cb184e34e748e7c3e1d724ee24263c18c19e9/lib/SourceMapDevToolPlugin.js#L77 Current stacktraces are not properly formatted ``` http://localhost:9876/_karma_webpack_/webpack:/src/app/dummy.component.spec.ts:36:76 ``` With this change we wil change this to ``` http://localhost:9876/src/app/validation-directive.ts:13:23 ``` This also allows users to click on the stacktrace in the browser and go to source.
1 parent 32feed1 commit 32e5ff9

File tree

2 files changed

+1
-1
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files

2 files changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export function getSourceMapDevTool(
9595
return new SourceMapDevToolPlugin({
9696
filename: inlineSourceMap ? undefined : '[file].map',
9797
include,
98+
moduleFilenameTemplate: '[namespace]/[resource-path]',
9899
append: hiddenSourceMap ? false : undefined,
99100
});
100101
}

packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts

-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ const init: any = (config: any, emitter: any, customFileHandlers: any) => {
147147
// Files need to be served from a custom path for Karma.
148148
webpackConfig.output.path = '/_karma_webpack_/';
149149
webpackConfig.output.publicPath = '/_karma_webpack_/';
150-
webpackConfig.output.devtoolModuleFilenameTemplate = '[namespace]/[resource-path]?[loaders]';
151150

152151
let compiler: any;
153152
try {

0 commit comments

Comments
 (0)