Skip to content

Commit df60930

Browse files
committed
fix(@angular/build): remap metafile cssBundle paths as well
Extends the metafile base path remapping to the cssBundle property of outputs, keeping all metafile path properties consistent with the workspace root. Addresses code review feedback.
1 parent 903062a commit df60930

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

packages/angular/build/src/tools/esbuild/bundler-context.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ export function remapMetafileBasePath(metafile: Metafile, fromBase: string, toBa
548548
if (value.entryPoint !== undefined) {
549549
value.entryPoint = remap(value.entryPoint);
550550
}
551+
if (value.cssBundle !== undefined) {
552+
value.cssBundle = remap(value.cssBundle);
553+
}
551554
for (const importRecord of value.imports) {
552555
if (!importRecord.external) {
553556
importRecord.path = remap(importRecord.path);

packages/angular/build/src/tools/esbuild/bundler-context_spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ describe('remapMetafileBasePath', () => {
3232
imports: [{ path: fromBaseRelative('chunk-ABC.js'), kind: 'import-statement' }],
3333
exports: [],
3434
entryPoint: fromBaseRelative('src/main.ts'),
35+
cssBundle: fromBaseRelative('main.css'),
3536
},
3637
},
3738
};
@@ -43,6 +44,7 @@ describe('remapMetafileBasePath', () => {
4344

4445
const output = metafile.outputs['main.js'];
4546
expect(output.entryPoint).toBe('src/main.ts');
47+
expect(output.cssBundle).toBe('main.css');
4648
expect(Object.keys(output.inputs)).toEqual(['src/main.ts']);
4749
expect(output.imports[0].path).toBe('chunk-ABC.js');
4850
});

0 commit comments

Comments
 (0)