Skip to content

Commit 3812852

Browse files
Merge pull request #2553 from CustomEntity/fix-assets-copying
Fix assets copying
2 parents ad18939 + 68508b2 commit 3812852

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/compiler/assets-manager.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ export class AssetsManager {
5959
sourceRoot = join(process.cwd(), sourceRoot);
6060

6161
const filesToCopy = assets.map<AssetEntry>((item) => {
62-
if (typeof item === 'string') {
63-
return {
64-
glob: join(sourceRoot, item),
65-
outDir,
66-
};
67-
}
62+
let includePath = typeof item === 'string' ? item : item.include!;
63+
let excludePath = typeof item !== 'string' && item.exclude ? item.exclude : undefined;
64+
65+
includePath = join(sourceRoot, includePath).replace(/\\/g, '/');
66+
excludePath = excludePath ? join(sourceRoot, excludePath).replace(/\\/g, '/') : undefined;
67+
6868
return {
69-
outDir: item.outDir || outDir,
70-
glob: join(sourceRoot, item.include!),
71-
exclude: item.exclude ? join(sourceRoot, item.exclude) : undefined,
72-
flat: item.flat, // deprecated field
73-
watchAssets: item.watchAssets,
69+
outDir: typeof item !== 'string' ? item.outDir || outDir : outDir,
70+
glob: includePath,
71+
exclude: excludePath,
72+
flat: typeof item !== 'string' ? item.flat : undefined, // deprecated field
73+
watchAssets: typeof item !== 'string' ? item.watchAssets : undefined,
7474
};
7575
});
7676

0 commit comments

Comments
 (0)