diff --git a/src/index.ts b/src/index.ts index 1917d0af1..1393deeb3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,7 +118,7 @@ const normalizeOptions = async ( } if (Array.isArray(entry)) { - const matcher = picomatch(entry) + const matcher = picomatch(entry, { windows: process.platform === 'win32' }) options.entry = await new fdir() .withRelativePaths() .filter((file) => matcher(file)) diff --git a/src/utils.ts b/src/utils.ts index b01e6fe9a..04c08a4ec 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -79,6 +79,7 @@ export async function removeFiles(patterns: string[], dir: string) { const matcher = picomatch(matchPatterns, { dot: true, ignore: ignorePatterns, + windows: process.platform === 'win32', }) const files = await new fdir() diff --git a/test/utils.ts b/test/utils.ts index 7924fa807..2b60ffb1a 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -61,7 +61,7 @@ export async function run( .withRelativePaths() .crawl(path.resolve(testDir, 'dist')) .withPromise() - .then((res) => res.sort()) + .then((res) => res.map((f) => f.replaceAll('\\', '/')).sort()) return { get output() {