diff --git a/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts b/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts index 55fd98811af4..b9e8ac5fa762 100644 --- a/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts +++ b/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts @@ -42,7 +42,7 @@ function getNameFromFilename(filename: string) { return base[0].toUpperCase() + base.slice(1); } -export function svelteDocgen(svelteOptions: Record): PluginOption { +export function svelteDocgen(svelteOptions: Record = {}): PluginOption { const cwd = process.cwd(); const { preprocess: preprocessOptions, logDocgen = false } = svelteOptions; const include = /\.(svelte)$/; diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index 0bca7efd1cde..bf7a7f742511 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -14,7 +14,7 @@ export const viteFinal: NonNullable = async (confi // TODO: set up eslint import to use typescript resolver // eslint-disable-next-line import/no-unresolved const { svelte, loadSvelteConfig } = await import('@sveltejs/vite-plugin-svelte'); - const svelteConfig = (await loadSvelteConfig()) || {}; + const svelteConfig = await loadSvelteConfig(); // Add svelte plugin if the user does not have a Vite config of their own if (!(await hasVitePlugins(plugins, ['vite-plugin-svelte']))) {