Skip to content

Commit 74dbd5f

Browse files
committed
fix(@angular-devkit/build-angular): support hidden component stylesheet sourcemaps with esbuild builder
The hidden stylesheet option was incorrectly being ignored for component stylesheets when using the experimental esbuild-based browser application builder. The hidden option will now correctly not include the stylesheet comment within the stylesheet text for components. (cherry picked from commit 53e9c45)
1 parent e5e07ff commit 74dbd5f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,11 @@ async function bundleCode(
306306
{
307307
workspaceRoot,
308308
optimization: !!optimizationOptions.styles.minify,
309-
sourcemap: !!sourcemapOptions.styles,
309+
sourcemap:
310+
// Hidden component stylesheet sourcemaps are inaccessible which is effectively
311+
// the same as being disabled. Disabling has the advantage of avoiding the overhead
312+
// of sourcemap processing.
313+
!!sourcemapOptions.styles && (sourcemapOptions.hidden ? false : 'inline'),
310314
outputNames,
311315
},
312316
),

packages/angular_devkit/build_angular/src/builders/browser-esbuild/stylesheets.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface BundleStylesheetOptions {
1414
workspaceRoot?: string;
1515
optimization: boolean;
1616
preserveSymlinks?: boolean;
17-
sourcemap: boolean | 'external';
17+
sourcemap: boolean | 'external' | 'inline';
1818
outputNames?: { bundles?: string; media?: string };
1919
}
2020

0 commit comments

Comments
 (0)