forked from TraceApps/nutritrace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
25 lines (24 loc) · 1.04 KB
/
Copy pathsvelte.config.js
File metadata and controls
25 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
// Svelte 5 compat shim — keep treating the codebase as Svelte 4.
// `componentApi: 4` makes `new App({ target })` in main.js work
// (Svelte 5's new default expects `mount(App, ...)` from 'svelte'
// instead). `runes: false` forces every file into legacy reactive
// mode regardless of script content, so the compiler doesn't
// auto-promote `$:` reactives in App.svelte to `$effect()` calls
// that fire during component construction and throw `effect_orphan`
// — that throw was surfacing to the user as the "Database Error"
// fallback in main.js (the catch was catching App's synchronous
// throw, NOT a real DB failure).
//
// `compatibility.componentApi` lives INSIDE `compilerOptions`, not
// as a sibling top-level key. (Hit that the first time around.)
//
// To migrate a single component to runes later, add
// `<svelte:options runes />` to that file.
export default {
preprocess: vitePreprocess(),
compilerOptions: {
runes: false,
compatibility: { componentApi: 4 },
},
};