Skip to content

Commit b6017cf

Browse files
committed
fixup! fix(@angular/build): resolve library bundle sourcemap sources relative to output directory
1 parent ca0842b commit b6017cf

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎packages/angular/build/src/builders/library/pipeline/bundler.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ async function executeMultiBundle(
304304
): Promise<MultiBundleOutput> {
305305
const { workspaceRoot, preserveSymlinks, declarationMap, outputPath } = options;
306306
const isDts = extension === 'd.ts';
307-
const relativeOutputPath = path.posix.relative(outputPath, workspaceRoot);
308307

309308
let sourcemap: boolean;
310309
let dir: string;
310+
311311
if (isDts) {
312312
dir = TYPES_OUTPUT_DIR;
313313
sourcemap = declarationMap;
@@ -333,11 +333,10 @@ async function executeMultiBundle(
333333
try {
334334
const { output } = await bundle.generate({
335335
format: 'es',
336-
dir,
336+
dir: path.join(outputPath, dir),
337337
entryFileNames: `[name].${extension}`,
338338
chunkFileNames: `[name]-[hash].${extension}`,
339339
sourcemap,
340-
sourcemapPathTransform: (sourcePath) => path.posix.join(relativeOutputPath, sourcePath),
341340
hoistTransitiveImports: false,
342341
comments: { jsdoc: isDts, legal: true, annotation: true },
343342
});

‎packages/angular/build/src/builders/library/tests/behavior/build_spec.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ describeLibraryBuilder(executeLibraryBuilder, LIBRARY_BUILDER_INFO, (harness) =>
2121
expect(result?.error).toBeUndefined();
2222
expect(result?.success).toBeTrue();
2323

24-
harness.expectFile('dist/lib/fesm2022/lib.mjs').toExist();
2524
harness.expectFile('dist/lib/fesm2022/lib.mjs').toExist();
2625
const fesmContent = harness.readFile('dist/lib/fesm2022/lib.mjs');
2726
expect(fesmContent).toContain('LibComponent');

0 commit comments

Comments
 (0)