mirror of
https://github.com/hoornet/vega.git
synced 2026-06-22 12:13:02 -07:00
build: migrate manualChunks to function form for Vite 8 / Rolldown
Vite 8 switches the bundler to Rolldown, which no longer accepts the object form of rollupOptions.output.manualChunks — it must be a function. Convert it (same ndk/vendor split intent) and give tsconfig.node.json a modern target/lib so vite.config.ts type-checks against String.includes.
This commit is contained in:
@@ -48,3 +48,6 @@ skills-lock.json
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# TypeScript incremental build info
|
||||
*.tsbuildinfo
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true
|
||||
|
||||
+5
-3
@@ -18,12 +18,14 @@ export default defineConfig(async () => ({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
// Vite 8 / Rolldown requires manualChunks as a function (the object
|
||||
// form is no longer accepted). Same intent as before:
|
||||
manualChunks(id: string) {
|
||||
// NDK is the largest dependency (~300kB) — split it out so the
|
||||
// main bundle parses faster at startup and the chunk can be cached.
|
||||
"ndk": ["@nostr-dev-kit/ndk"],
|
||||
if (id.includes("node_modules/@nostr-dev-kit/ndk")) return "ndk";
|
||||
// React runtime — stable across releases, cache-friendly.
|
||||
"vendor": ["react", "react-dom"],
|
||||
if (id.includes("node_modules/react-dom/") || id.includes("node_modules/react/")) return "vendor";
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user