Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): correct esbuild builder global st…
Browse files Browse the repository at this point in the history
…ylesheet sourcemap URL

The sourcemap URL in the output CSS files for global stylesheets is now correctly updated to
reflect the name of the global stylesheet output file and not the internal `stdin` virtual
file name.

(cherry picked from commit b647d80)
  • Loading branch information
clydin authored and dgp1130 committed Aug 25, 2022
1 parent d976405 commit 5bd0335
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -386,10 +386,15 @@ async function bundleGlobalStylesheets(
// with the actual name of the global style and the leading directory separator must
// also be removed to make the path relative.
const sheetPath = sheetResult.path.replace('stdin', name);
outputFiles.push(createOutputFileFromText(sheetPath, sheetResult.contents));
let sheetContents = sheetResult.contents;
if (sheetResult.map) {
outputFiles.push(createOutputFileFromText(sheetPath + '.map', sheetResult.map));
sheetContents = sheetContents.replace(
'sourceMappingURL=stdin.css.map',
`sourceMappingURL=${name}.css.map`,
);
}
outputFiles.push(createOutputFileFromText(sheetPath, sheetContents));

if (!noInjectNames.includes(name)) {
initialFiles.push({
Expand Down

0 comments on commit 5bd0335

Please sign in to comment.