Skip to content

Commit

Permalink
Move the default value into the svelte-docgen plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
justineloff committed Mar 2, 2023
1 parent 198e6f0 commit 5f214d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getNameFromFilename(filename: string) {
return base[0].toUpperCase() + base.slice(1);
}

export function svelteDocgen(svelteOptions: Record<string, any>): PluginOption {
export function svelteDocgen(svelteOptions: Record<string, any> = {}): PluginOption {
const cwd = process.cwd();
const { preprocess: preprocessOptions, logDocgen = false } = svelteOptions;
const include = /\.(svelte)$/;
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/svelte-vite/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const viteFinal: NonNullable<StorybookConfig['viteFinal']> = 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']))) {
Expand Down

0 comments on commit 5f214d0

Please sign in to comment.