mango-cms 0.3.29 → 0.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/default/package.json +1 -1
- package/package.json +1 -1
- package/vite.config.js +12 -0
package/default/package.json
CHANGED
package/package.json
CHANGED
package/vite.config.js
CHANGED
|
@@ -34,6 +34,17 @@ export default defineConfig(({ mode }) => {
|
|
|
34
34
|
|
|
35
35
|
const buildPath = legacyMode ? mangoRoot : userProjectRoot
|
|
36
36
|
|
|
37
|
+
// HAP-1180: honour an explicit per-worktree Vite cache dir. Every per-branch
|
|
38
|
+
// vibe dev watcher (`vite build --watch`) is spawned with cwd = the SHARED
|
|
39
|
+
// node_modules/mango-cms, so without an override they all share one default
|
|
40
|
+
// `.vite` optimize cache and contend — the cross-branch half of the
|
|
41
|
+
// leaked-watcher → white-screen failure (HAP-1179). The dev-server wrapper
|
|
42
|
+
// (generations-vibe mango/helpers/vibeDevServer.mjs) exports
|
|
43
|
+
// MANGO_VITE_CACHE_DIR=<worktree>/.vite-cache (absolute); read it here so each
|
|
44
|
+
// worktree's build keeps an isolated cache. No-op when the env var is unset.
|
|
45
|
+
const cacheDir = process.env.MANGO_VITE_CACHE_DIR || process.env.VITE_CACHE_DIR || undefined
|
|
46
|
+
if (cacheDir) console.log('Vite cacheDir (per-worktree):', cacheDir)
|
|
47
|
+
|
|
37
48
|
// Auto-detect dependencies to externalize (avoids bundling native modules, etc.)
|
|
38
49
|
const getDeps = (pkgPath) => {
|
|
39
50
|
if (!fs.existsSync(pkgPath)) return []
|
|
@@ -59,6 +70,7 @@ export default defineConfig(({ mode }) => {
|
|
|
59
70
|
})
|
|
60
71
|
|
|
61
72
|
return {
|
|
73
|
+
...(cacheDir ? { cacheDir } : {}),
|
|
62
74
|
build: {
|
|
63
75
|
ssr: path.resolve(mangoRoot, 'src/main.js'),
|
|
64
76
|
outDir: path.resolve(buildPath, 'build'),
|