From ff3acc0eb365607a278af896cf36bb00180bf46b Mon Sep 17 00:00:00 2001 From: Superchupu <53496941+SuperchupuDev@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:20:57 +0000 Subject: [PATCH] fix: windows paths --- src/index.ts | 2 +- src/utils.ts | 1 + test/utils.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 97a8de449..c9af0fd20 100644 --- a/src/index.ts +++ b/src/index.ts @@ -119,7 +119,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() {