Skip to content

Commit a09a119

Browse files
committed
fixup! refactor(@angular/build): normalize library builder paths to POSIX format
1 parent 655d8bb commit a09a119

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • packages/angular/build/src/builders/library/pipeline

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ export async function collectAssetsToEmit(
3535
const filesToEmit: DiskOutputFile[] = [];
3636

3737
for (const file of modifiedFiles) {
38-
for (const { asset, isMatch } of matchers) {
39-
const relative = path.posix.relative(asset.input, file);
40-
if (!relative || relative.startsWith('..') || path.posix.isAbsolute(relative)) {
38+
for (const { asset, prefix, isMatch } of matchers) {
39+
if (!file.startsWith(prefix)) {
4140
continue;
4241
}
4342

43+
const relative = file.slice(prefix.length);
4444
if (!isMatch(relative)) {
4545
continue;
4646
}
@@ -65,7 +65,8 @@ function createAssetMatchers(assets: NormalizedLibraryOptions['assets']) {
6565
dot: true,
6666
ignore: [...DEFAULT_ASSET_IGNORE, ...(asset.ignore ?? [])],
6767
});
68+
const prefix = asset.input.endsWith('/') ? asset.input : `${asset.input}/`;
6869

69-
return { asset, isMatch };
70+
return { asset, prefix, isMatch };
7071
});
7172
}

0 commit comments

Comments
 (0)