fix(docs): cap vite below 7 (rolldown-vite) and pin mermaid transitives #161

Merged
julien merged 1 commits from fix/docs-site-cap-vite-below-rolldown into main 2026-05-15 23:57:58 +02:00
3 changed files with 502 additions and 439 deletions
Showing only changes of commit 003dc35f71 - Show all commits
+11 -10
View File
@@ -161,18 +161,19 @@ export default withMermaid(
securityLevel: 'strict',
},
// Mermaid 11 ships its `dayjs` / `cytoscape` dependencies with a
// CommonJS `main` field but no `default` ESM export. Vite's dev
// server resolves those modules eagerly as ESM and the browser
// throws `does not provide an export named 'default'` on the
// first navigation. Telling `optimizeDeps` to pre-bundle the
// Mermaid dependency tree forces the CJS→ESM interop wrapper
// that Vite's Rollup-based build already applies in prod. The
// production build (`docs:build`) was unaffected even before
// this; this fix is exclusively for the `docs:dev` happy path.
// Pre-bundle Mermaid through Vite's dep optimizer. When this was
// first added (#157) Vite 5's dev server resolved Mermaid's CJS
// transitives (`dayjs`, `cytoscape`, `debug`, `@braintree/sanitize-url`)
// eagerly as ESM and the browser threw `does not provide an export
// named 'default'` on the first navigation. With Vite 6 — to which
// we're now pinned per ADR-0022's "stable, recognized" bar (#160
// capped vite below 7 because VitePress 1.x rejects the new
// rolldown-vite) — the pre-bundler walks Mermaid's transitives
// automatically once Mermaid itself is in `include`, so the
// explicit list of children has been collapsed.
vite: {
optimizeDeps: {
include: ['mermaid', 'dayjs', 'debug', '@braintree/sanitize-url'],
include: ['mermaid'],
},
},
}),
+6 -1
View File
@@ -44,7 +44,7 @@
"ip-address@<10.1.1": ">=10.1.1",
"protobufjs@<8.0.2": ">=8.0.2",
"tmp@<0.2.4": ">=0.2.4",
"vite@<6.4.2": ">=6.4.2",
"vite": ">=6.4.2 <7",
"yaml@<2.8.3": ">=2.8.3",
"@types/express": "^5.0.6"
}
@@ -61,6 +61,7 @@
"@angular/cli": "~21.2.0",
"@angular/compiler-cli": "~21.2.0",
"@angular/language-service": "~21.2.0",
"@braintree/sanitize-url": "^7.1.2",
"@commitlint/cli": "^20.5.3",
"@commitlint/config-conventional": "^20.5.3",
"@eslint/js": "^9.8.0",
@@ -96,6 +97,10 @@
"@vitest/coverage-v8": "~4.1.0",
"@vitest/ui": "~4.1.0",
"angular-eslint": "^21.2.0",
"cytoscape": "^3.33.3",
"cytoscape-cose-bilkent": "^4.1.0",
"dayjs": "^1.11.20",
"debug": "^4.4.3",
"eslint": "^9.8.0",
"eslint-config-prettier": "^10.0.0",
"eslint-plugin-playwright": "^1.6.2",
+485 -428
View File
File diff suppressed because it is too large Load Diff