mango-cms 0.3.29 → 0.3.30

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vite.config.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.3.29",
3
+ "version": "0.3.30",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "exports": {
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'),