Skip to content

Commit 32050ca

Browse files
alan-agius4clydin
authored andcommitted
Revert "fix(@angular-devkit/build-angular): control linker template sourcemapping via builder sourcemap options"
This reverts commit d4c5f85. Following a debugging and investigation with @petebacondarwin it appears that when the external template handling in the linker generates Babel AST nodes that reference the external template files which breaks Babel when it tried to flatten final source-map, which ends up no emitting any source-maps. As an interim solution we should revert this. Closes #21271
1 parent 1f6a551 commit 32050ca

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

packages/angular_devkit/build_angular/src/babel/presets/application.ts

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export interface ApplicationPresetOptions {
2020
angularLinker?: {
2121
shouldLink: boolean;
2222
jitMode: boolean;
23-
sourcemap: boolean;
2423
};
2524

2625
forceES5?: boolean;
@@ -138,7 +137,6 @@ export default function (api: unknown, options: ApplicationPresetOptions) {
138137
plugins.push(
139138
createEs2015LinkerPlugin({
140139
linkerJitMode: options.angularLinker.jitMode,
141-
sourceMapping: options.angularLinker.sourcemap,
142140
logger: createNgtscLogger(options.diagnosticReporter),
143141
fileSystem: {
144142
resolve: path.resolve,

packages/angular_devkit/build_angular/src/babel/webpack-loader.ts

-10
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export default custom<AngularCustomOptions>(() => {
5858
customOptions.angularLinker = {
5959
shouldLink: true,
6060
jitMode: aot !== true,
61-
sourcemap: false,
6261
};
6362
shouldProcess = true;
6463
}
@@ -141,15 +140,6 @@ export default custom<AngularCustomOptions>(() => {
141140
);
142141
}
143142

144-
// Only enable linker template sourcemapping if linker is enabled and Webpack provides
145-
// a sourcemap. This logic allows the linker sourcemap behavior to be controlled by the
146-
// Webpack sourcemap configuration. For example, if a vendor file is being processed
147-
// and vendor sourcemaps are disabled, the `inputSourceMap` property will be `undefined`
148-
// which will effectively disable linker sourcemapping for vendor files.
149-
if (customOptions.angularLinker && configuration.options.inputSourceMap) {
150-
customOptions.angularLinker.sourcemap = true;
151-
}
152-
153143
return {
154144
...configuration.options,
155145
// Workaround for https://github.com/babel/babel-loader/pull/896 is available

0 commit comments

Comments
 (0)