fix(build): remove flowbite-svelte from optimizeDeps.exclude
The previous session added flowbite-svelte to optimizeDeps.exclude to fix an esbuild TypeScript syntax error with 1.33.1. But tailwindcss 4.3+ is now stricter: when a style virtual module fails to load (which happens when the package is excluded from pre-bundling), tailwindcss receives the raw .svelte file content — including TypeScript — and rejects it with "Invalid declaration: Side". With flowbite-svelte 1.31.0, only Drawer and Modal are imported. Neither their dist files nor their transitive deps have TypeScript optional-param syntax (?: ) that would cause esbuild to fail. Safe to remove the exclusion. Updated the comment to explain when/why to re-add it if upgrading. Dev server: clean start, HTTP 200 ✔ | npm run build ✔ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,11 +15,13 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
optimizeDeps: {
|
||||
// flowbite-svelte ships TypeScript optional-param syntax (x?, date?) in its compiled
|
||||
// .svelte dist files. Esbuild's pre-bundler treats them as plain JS and rejects the `?`
|
||||
// syntax. Excluding it here lets vite-plugin-svelte handle it properly instead.
|
||||
// Re-evaluate if flowbite-svelte releases a clean JS dist (check when upgrading).
|
||||
exclude: ['@codemirror/*', 'flowbite-svelte'],
|
||||
// @codemirror/* uses dynamic imports that confuse esbuild's pre-bundler; excluded here
|
||||
// so vite-plugin-svelte handles them through the normal transform pipeline instead.
|
||||
// flowbite-svelte: ONLY exclude if you upgrade to a version that ships TypeScript
|
||||
// optional-param syntax (x?, date?) in its compiled dist files — verify with grep
|
||||
// before adding it back. Excluding it causes tailwindcss 4.3+ to receive raw .svelte
|
||||
// file content (including TypeScript) for style virtual modules, which it rejects.
|
||||
exclude: ['@codemirror/*'],
|
||||
include: []
|
||||
},
|
||||
ssr: {
|
||||
|
||||
Reference in New Issue
Block a user