-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into 20780-unattached-source-code
- Loading branch information
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Plugin } from 'vite'; | ||
|
||
export function configOverrides() { | ||
return { | ||
name: 'storybook:sveltekit-overrides', | ||
config: (conf) => { | ||
// Some versions of sveltekit set ssr, we need it to be false | ||
if (conf.build?.ssr) { | ||
// eslint-disable-next-line no-param-reassign | ||
conf.build.ssr = false; | ||
} | ||
return conf; | ||
}, | ||
} satisfies Plugin; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
import { viteFinal as svelteViteFinal } from '@storybook/svelte-vite/preset'; | ||
import type { PresetProperty } from '@storybook/types'; | ||
import { withoutVitePlugins } from '@storybook/builder-vite'; | ||
import { configOverrides } from './plugins/config-overrides'; | ||
import { type StorybookConfig } from './types'; | ||
|
||
export const core: PresetProperty<'core', StorybookConfig> = { | ||
|
@@ -16,10 +17,12 @@ export const viteFinal: NonNullable<StorybookConfig['viteFinal']> = async (confi | |
|
||
// Remove vite-plugin-svelte-kit from plugins if using SvelteKit | ||
// see https://github.com/storybookjs/storybook/issues/19280#issuecomment-1281204341 | ||
plugins = await withoutVitePlugins(plugins, [ | ||
// @sveltejs/[email protected] and later | ||
'vite-plugin-sveltekit-compile', | ||
]); | ||
plugins = ( | ||
await withoutVitePlugins(plugins, [ | ||
// @sveltejs/[email protected] and later | ||
'vite-plugin-sveltekit-compile', | ||
]) | ||
).concat(configOverrides()); | ||
|
||
return { ...baseConfig, plugins }; | ||
}; |