|
| 1 | +diff --git a/dist/node/chunks/node.js b/dist/node/chunks/node.js |
| 2 | +index 8d6dbaf1f21914bcf02576f8a5f13546a3dcdce8..49b30abd781d906c2cbc47e6c035f00f70b26554 100644 |
| 3 | +--- a/dist/node/chunks/node.js |
| 4 | ++++ b/dist/node/chunks/node.js |
| 5 | +@@ -35651,17 +35651,19 @@ const _require = createRequire( |
| 6 | + ); |
| 7 | + async function loadConfigFromBundledFile(fileName, bundledCode, isESM) { |
| 8 | + if (isESM) { |
| 9 | +- let nodeModulesDir = typeof process.versions.deno === "string" ? void 0 : findNearestNodeModules(path.dirname(fileName)); |
| 10 | +- if (nodeModulesDir) try { |
| 11 | +- await fsp.mkdir(path.resolve(nodeModulesDir, ".vite-temp/"), { recursive: true }); |
| 12 | ++ const nodeModulesDir = typeof process.versions.deno === "string" ? void 0 : findNearestNodeModules(path.dirname(fileName)); |
| 13 | ++ let viteTempDir = nodeModulesDir ? path.resolve(nodeModulesDir, ".vite-temp") : void 0; |
| 14 | ++ if (viteTempDir) try { |
| 15 | ++ await fsp.mkdir(viteTempDir, { recursive: true }); |
| 16 | + } catch (e) { |
| 17 | +- if (e.code === "EACCES") nodeModulesDir = void 0; |
| 18 | ++ if (e.code === "EACCES") viteTempDir = void 0; |
| 19 | + else throw e; |
| 20 | + } |
| 21 | + const hash = `timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`; |
| 22 | +- const tempFileName = nodeModulesDir ? path.resolve(nodeModulesDir, `.vite-temp/${path.basename(fileName)}.${hash}.mjs`) : `${fileName}.${hash}.mjs`; |
| 23 | +- ignoreInput(tempFileName); |
| 24 | +- ignoreOutput(tempFileName); |
| 25 | ++ const tempFileName = viteTempDir ? path.resolve(viteTempDir, `${path.basename(fileName)}.${hash}.mjs`) : `${fileName}.${hash}.mjs`; |
| 26 | ++ const pathToIgnore = viteTempDir ?? tempFileName; |
| 27 | ++ ignoreInput(pathToIgnore); |
| 28 | ++ ignoreOutput(pathToIgnore); |
| 29 | + await fsp.writeFile(tempFileName, bundledCode); |
| 30 | + try { |
| 31 | + return (await import(pathToFileURL(tempFileName).href)).default; |
0 commit comments