Skip to content

Commit

Permalink
fix(loader): side effect of manifest item (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahziheng authored Apr 21, 2023
1 parent 40290d8 commit 454edf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/loader/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ export class LoaderFactory {

// group by loader names
for (const item of itemList) {
item.path = root ? path.join(root, item.path) : item.path;
item.loader = item.loader ?? DEFAULT_LOADER;
if (!itemMap.has(item.loader)) {
// compatible for custom loader
itemMap.set(item.loader, []);
}
itemMap.get(item.loader)!.push(item);
itemMap.get(item.loader)!.push({
...item,
path: root ? path.join(root, item.path) : item.path,
loader: item.loader ?? DEFAULT_LOADER,
});
}

// trigger loader
Expand Down

0 comments on commit 454edf5

Please sign in to comment.