Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"tasks": {
"build": {
// TODO: --configLoader runner works around a Vite config-loader bug that makes this cache non-portable.
"command": "vite build --configLoader runner",
"command": "vite build",
"cache": true
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"tasks": {
"build": {
// TODO: --configLoader runner works around a Vite config-loader bug that makes this cache non-portable.
"command": "vite build --configLoader runner",
"command": "vite build",
"cache": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Two identical plain Vite workspaces run from different absolute roots. The test
origin workspace root: cache miss populates its default cache

```
$ vite build --configLoader runner
$ vite build
```

## `cd portable_origin && vtt stat-file dist/assets/index.js`
Expand All @@ -30,7 +30,7 @@ copy-paste the cache directory to simulate upload/download
clone workspace root: cache hit from the origin root

```
$ vite build --configLoader runner ◉ cache hit, replaying
$ vite build ◉ cache hit, replaying

---
vt run: cache hit.
Expand Down
31 changes: 31 additions & 0 deletions patches/vite@8.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/dist/node/chunks/node.js b/dist/node/chunks/node.js
index 8d6dbaf1f21914bcf02576f8a5f13546a3dcdce8..49b30abd781d906c2cbc47e6c035f00f70b26554 100644
--- a/dist/node/chunks/node.js
+++ b/dist/node/chunks/node.js
@@ -35651,17 +35651,19 @@ const _require = createRequire(
);
async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
if (isESM) {
- let nodeModulesDir = typeof process.versions.deno === "string" ? void 0 : findNearestNodeModules(path.dirname(fileName));
- if (nodeModulesDir) try {
- await fsp.mkdir(path.resolve(nodeModulesDir, ".vite-temp/"), { recursive: true });
+ const nodeModulesDir = typeof process.versions.deno === "string" ? void 0 : findNearestNodeModules(path.dirname(fileName));
+ let viteTempDir = nodeModulesDir ? path.resolve(nodeModulesDir, ".vite-temp") : void 0;
+ if (viteTempDir) try {
+ await fsp.mkdir(viteTempDir, { recursive: true });
} catch (e) {
- if (e.code === "EACCES") nodeModulesDir = void 0;
+ if (e.code === "EACCES") viteTempDir = void 0;
else throw e;
}
const hash = `timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`;
- const tempFileName = nodeModulesDir ? path.resolve(nodeModulesDir, `.vite-temp/${path.basename(fileName)}.${hash}.mjs`) : `${fileName}.${hash}.mjs`;
- ignoreInput(tempFileName);
- ignoreOutput(tempFileName);
+ const tempFileName = viteTempDir ? path.resolve(viteTempDir, `${path.basename(fileName)}.${hash}.mjs`) : `${fileName}.${hash}.mjs`;
+ const pathToIgnore = viteTempDir ?? tempFileName;
+ ignoreInput(pathToIgnore);
+ ignoreOutput(pathToIgnore);
await fsp.writeFile(tempFileName, bundledCode);
try {
return (await import(pathToFileURL(tempFileName).href)).default;
51 changes: 27 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ overrides:
# override above routes vite to the Vite+ toolchain fork, which does not carry
# the integration — so scope vite-task-tools' `vite` to a real upstream build.
vite-task-tools>vite: ^8.1.0
patchedDependencies:
vite@8.1.0: patches/vite@8.1.0.patch
peerDependencyRules:
allowAny:
- vite
Expand Down
Loading