fix: normalize path to support window (#1378)

This commit is contained in:
chilingling 2025-05-09 20:19:00 +08:00 committed by GitHub
parent c289ae316f
commit ac87d46fef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import path from 'node:path'
import fs from 'fs-extra'
import fg from 'fast-glob'
import { normalizePath } from 'vite'
import { babelReplaceImportPathWithCertainFileName } from '../localCdnFile/replaceImportPath.mjs'
/**
@ -77,7 +78,7 @@ async function copyFileOrDirectory(srcPath, destPaths, copiedFiles, outDir) {
await fs.ensureDir(fullDestPath)
// 使用绝对路径
const absoluteSrcPath = path.resolve(process.cwd(), srcPath)
const absoluteSrcPath = normalizePath(path.resolve(process.cwd(), srcPath))
// 使用 fast-glob 查找所有文件
const files = fg.sync(`${absoluteSrcPath}/**/*`, { onlyFiles: true })