Skip to content

Commit

Permalink
Merge pull request #2553 from CustomEntity/fix-assets-copying
Browse files Browse the repository at this point in the history
Fix assets copying
  • Loading branch information
kamilmysliwiec authored Jul 2, 2024
2 parents ad18939 + 68508b2 commit 3812852
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/compiler/assets-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ export class AssetsManager {
sourceRoot = join(process.cwd(), sourceRoot);

const filesToCopy = assets.map<AssetEntry>((item) => {
if (typeof item === 'string') {
return {
glob: join(sourceRoot, item),
outDir,
};
}
let includePath = typeof item === 'string' ? item : item.include!;
let excludePath = typeof item !== 'string' && item.exclude ? item.exclude : undefined;

includePath = join(sourceRoot, includePath).replace(/\\/g, '/');
excludePath = excludePath ? join(sourceRoot, excludePath).replace(/\\/g, '/') : undefined;

return {
outDir: item.outDir || outDir,
glob: join(sourceRoot, item.include!),
exclude: item.exclude ? join(sourceRoot, item.exclude) : undefined,
flat: item.flat, // deprecated field
watchAssets: item.watchAssets,
outDir: typeof item !== 'string' ? item.outDir || outDir : outDir,
glob: includePath,
exclude: excludePath,
flat: typeof item !== 'string' ? item.flat : undefined, // deprecated field
watchAssets: typeof item !== 'string' ? item.watchAssets : undefined,
};
});

Expand Down

0 comments on commit 3812852

Please sign in to comment.