Skip to content

Commit 53e9c45

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.
1 parent 93ba050 commit 53e9c45

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
@@ -328,7 +328,11 @@ async function bundleCode(
328328
{
329329
workspaceRoot,
330330
optimization: !!optimizationOptions.styles.minify,
331-
sourcemap: !!sourcemapOptions.styles,
331+
sourcemap:
332+
// Hidden component stylesheet sourcemaps are inaccessible which is effectively
333+
// the same as being disabled. Disabling has the advantage of avoiding the overhead
334+
// of sourcemap processing.
335+
!!sourcemapOptions.styles && (sourcemapOptions.hidden ? false : 'inline'),
332336
outputNames,
333337
},
334338
),

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)