Skip to content

Commit c126333

Browse files
committed
fixup! fix(@angular/build): support incremental asset updates and output cleanup in library watch mode
1 parent ab8ae6c commit c126333

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface CollectedAssets {
2626

2727
interface AssetMatcher {
2828
asset: NormalizedLibraryOptions['assets'][number];
29-
posixInputPrefix: string;
29+
prefix: string;
3030
isMatch: picomatch.Matcher;
3131
}
3232

@@ -68,12 +68,12 @@ export async function collectAssetsToEmit(
6868
}
6969
}
7070

71-
for (const { asset, posixInputPrefix, isMatch } of matchers) {
72-
if (!file.startsWith(posixInputPrefix)) {
71+
for (const { asset, prefix, isMatch } of matchers) {
72+
if (!file.startsWith(prefix)) {
7373
continue;
7474
}
7575

76-
const relative = file.slice(posixInputPrefix.length);
76+
const relative = file.slice(prefix.length);
7777
if (!isMatch(relative)) {
7878
continue;
7979
}
@@ -108,13 +108,13 @@ function getAssetMatchers(assets: NormalizedLibraryOptions['assets']): AssetMatc
108108
let matchers = assetMatcherCache.get(assets);
109109
if (!matchers) {
110110
matchers = assets.map((asset) => {
111-
const posixInput = asset.input.replace(/\/+$/, '');
112111
const isMatch = picomatch(asset.glob, {
113112
dot: true,
114113
ignore: [...DEFAULT_ASSET_IGNORE, ...(asset.ignore ?? [])],
115114
});
115+
const prefix = asset.input.endsWith('/') ? asset.input : `${asset.input}/`;
116116

117-
return { asset, posixInputPrefix: `${posixInput}/`, isMatch };
117+
return { asset, prefix, isMatch };
118118
});
119119
assetMatcherCache.set(assets, matchers);
120120
}

0 commit comments

Comments
 (0)