Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Copying assets failed on Windows #2586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/compiler/assets-manager.ts
Expand Up @@ -101,7 +101,12 @@ export class AssetsManager {

this.watchers.push(watcher);
} else {
const files = sync(item.glob, { ignore: item.exclude }).filter(
// Glob patterns should always use / as a path separator, even on
// Windows systems, as \ is used to escape glob characters.
const reg = /\\/g;
const glob = item.glob.replace(reg, '/');
const exclude = item.exclude && item.exclude.replace(reg, '/');
const files = sync(glob, { ignore: exclude }).filter(
(matched) => statSync(matched).isFile(),
);
for (const path of files) {
Expand Down