Skip to content

Commit

Permalink
wip: windows path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed May 25, 2024
1 parent 9a9eb1c commit 189d2dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node/processor/FileCacheProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import createDebug from 'debug'
import fs from 'fs-extra'
import path from 'node:path'
import colors from 'picocolors'
import { normalizePath } from 'vite'
import { globalConfig } from '../global-config'
import { writeFile } from '../helper/io'
import { findAllOldJsFile, pkgName } from '../helper/utils'
Expand Down Expand Up @@ -65,7 +64,9 @@ export class FileCacheProcessor extends ManifestCacheProcessor {

const jsFilePath = this.setCache(args, globalConfig.all)

fs.ensureDirSync(normalizePath(path.dirname(path.normalize(jsFilePath))))
if (!fs.existsSync(jsFilePath)) {
fs.ensureFileSync(jsFilePath)
}

writeFile(jsFilePath, code)
}
Expand Down

0 comments on commit 189d2dd

Please sign in to comment.