From 048c93b34671e6fe6cf48600ed6667cab7b6fb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Thu, 25 Jul 2024 00:16:49 +0800 Subject: [PATCH] fix: get metafile on windows --- src/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin.ts b/src/plugin.ts index e5c4d478..16e5f77c 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -12,7 +12,7 @@ import type { } from 'esbuild' import type { Format, NormalizedOptions } from '.' import type { Logger } from './log' -import type { MaybePromise } from './utils' +import { slash, type MaybePromise } from './utils' import type { SourceMap } from 'rollup' export type ChunkInfo = { @@ -132,7 +132,7 @@ export class PluginContainer { .filter((file) => !file.path.endsWith('.map')) .map((file): ChunkInfo | AssetInfo => { if (isJS(file.path) || isCSS(file.path)) { - const relativePath = path.relative(process.cwd(), file.path) + const relativePath = slash(path.relative(process.cwd(), file.path)) const meta = metafile?.outputs[relativePath] return { type: 'chunk',