Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): support hidden component styleshe…
Browse files Browse the repository at this point in the history
…et 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)
  • Loading branch information
clydin committed Jul 1, 2022
1 parent e5e07ff commit 74dbd5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ async function bundleCode(
{
workspaceRoot,
optimization: !!optimizationOptions.styles.minify,
sourcemap: !!sourcemapOptions.styles,
sourcemap:
// Hidden component stylesheet sourcemaps are inaccessible which is effectively
// the same as being disabled. Disabling has the advantage of avoiding the overhead
// of sourcemap processing.
!!sourcemapOptions.styles && (sourcemapOptions.hidden ? false : 'inline'),
outputNames,
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface BundleStylesheetOptions {
workspaceRoot?: string;
optimization: boolean;
preserveSymlinks?: boolean;
sourcemap: boolean | 'external';
sourcemap: boolean | 'external' | 'inline';
outputNames?: { bundles?: string; media?: string };
}

Expand Down

0 comments on commit 74dbd5f

Please sign in to comment.