fix: suppress svelte chunk circular dep warnings via manualChunks
Rollup was splitting svelte/src/internal/client/runtime.js into a different chunk from svelte/src/index-client.js, producing ~35 warnings about untrack/tick re-exports leading to broken execution order. Add manualChunks function to vite.config.ts to colocate all svelte node_modules into a single 'svelte-vendor' chunk, keeping runtime.js and index-client.js together.
This commit is contained in:
@@ -6,5 +6,18 @@ export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
sveltekit() // <-- Must come after Tailwind
|
||||
]
|
||||
],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// Keep all svelte internals in one chunk to prevent circular
|
||||
// dependency warnings between runtime.js and index-client.js
|
||||
manualChunks(id) {
|
||||
if (id.includes('/node_modules/svelte/')) {
|
||||
return 'svelte-vendor';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user