Skip to content

Commit

Permalink
chore: use .vite-temp
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Oct 30, 2024
1 parent a5d7423 commit 2c61714
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
@@ -1692,15 +1692,15 @@ async function loadConfigFromBundledFile(
if (isESM) {
const nodeModulesDir = findNearestNodeModules(path.dirname(fileName))
if (nodeModulesDir) {
await fsp.mkdir(path.resolve(nodeModulesDir, '.vite/configs/'), {
await fsp.mkdir(path.resolve(nodeModulesDir, '.vite-temp/'), {
recursive: true,
})
}
const hash = `timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`
const tempFileName = nodeModulesDir
? path.resolve(
nodeModulesDir,
`.vite/configs/${path.basename(fileName)}.${hash}.mjs`,
`.vite-temp/${path.basename(fileName)}.${hash}.mjs`,
)
: `${fileName}.${hash}.mjs`
await fsp.writeFile(tempFileName, bundledCode)

0 comments on commit 2c61714

Please sign in to comment.