Skip to content

Commit

Permalink
Merge pull request #21290 from storybookjs/21053-bug-hmr-not-working-…
Browse files Browse the repository at this point in the history
…on-sveltekit-and-storybook

SvelteKit: Only disable SSR when building, not serving
  • Loading branch information
JReinhold authored Feb 28, 2023
2 parents 3bebd73 + 485eba6 commit 9e4ab66
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions code/frameworks/sveltekit/src/plugins/config-overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import type { Plugin } from 'vite';

export function configOverrides() {
return {
// SvelteKit sets SSR, we need it to be false when building
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;
apply: 'build',
config: () => {
return { build: { ssr: false } };
},
} satisfies Plugin;
}

0 comments on commit 9e4ab66

Please sign in to comment.