Skip to content

Commit

Permalink
Revert "fix(@angular-devkit/build-angular): control linker template s…
Browse files Browse the repository at this point in the history
…ourcemapping 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
  • Loading branch information
alan-agius4 committed Jul 5, 2021
1 parent 34e66ff commit da74c6e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export interface ApplicationPresetOptions {
angularLinker?: {
shouldLink: boolean;
jitMode: boolean;
sourcemap: boolean;
};

forceES5?: boolean;
Expand Down Expand Up @@ -138,7 +137,6 @@ export default function (api: unknown, options: ApplicationPresetOptions) {
plugins.push(
createEs2015LinkerPlugin({
linkerJitMode: options.angularLinker.jitMode,
sourceMapping: options.angularLinker.sourcemap,
logger: createNgtscLogger(options.diagnosticReporter),
fileSystem: {
resolve: path.resolve,
Expand Down
10 changes: 0 additions & 10 deletions packages/angular_devkit/build_angular/src/babel/webpack-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default custom<AngularCustomOptions>(() => {
customOptions.angularLinker = {
shouldLink: true,
jitMode: aot !== true,
sourcemap: false,
};
shouldProcess = true;
}
Expand Down Expand Up @@ -141,15 +140,6 @@ export default custom<AngularCustomOptions>(() => {
);
}

// Only enable linker template sourcemapping if linker is enabled and Webpack provides
// a sourcemap. This logic allows the linker sourcemap behavior to be controlled by the
// Webpack sourcemap configuration. For example, if a vendor file is being processed
// and vendor sourcemaps are disabled, the `inputSourceMap` property will be `undefined`
// which will effectively disable linker sourcemapping for vendor files.
if (customOptions.angularLinker && configuration.options.inputSourceMap) {
customOptions.angularLinker.sourcemap = true;
}

return {
...configuration.options,
// Workaround for https://github.com/babel/babel-loader/pull/896 is available
Expand Down

0 comments on commit da74c6e

Please sign in to comment.