Skip to content

Commit 9ca89d9

Browse files
authored
Revert "fix(@angular-devkit/build-angular): control linker template sourcemapping via builder sourcemap options"
This reverts commit d4c5f85.
1 parent 34e66ff commit 9ca89d9

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

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

Lines changed: 4 additions & 6 deletions
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;
@@ -32,8 +31,7 @@ export interface ApplicationPresetOptions {
3231
type I18nDiagnostics = import('@angular/localize/src/tools/src/diagnostics').Diagnostics;
3332
function createI18nDiagnostics(reporter: DiagnosticReporter | undefined): I18nDiagnostics {
3433
// Babel currently is synchronous so import cannot be used
35-
const diagnostics: I18nDiagnostics =
36-
new (require('@angular/localize/src/tools/src/diagnostics').Diagnostics)();
34+
const diagnostics: I18nDiagnostics = new (require('@angular/localize/src/tools/src/diagnostics').Diagnostics)();
3735

3836
if (!reporter) {
3937
return diagnostics;
@@ -132,13 +130,13 @@ export default function (api: unknown, options: ApplicationPresetOptions) {
132130

133131
if (options.angularLinker?.shouldLink) {
134132
// Babel currently is synchronous so import cannot be used
135-
const { createEs2015LinkerPlugin } =
136-
require('@angular/compiler-cli/linker/babel') as typeof import('@angular/compiler-cli/linker/babel');
133+
const {
134+
createEs2015LinkerPlugin,
135+
} = require('@angular/compiler-cli/linker/babel') as typeof import('@angular/compiler-cli/linker/babel');
137136

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

Lines changed: 0 additions & 10 deletions
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)