From 72cca119744d575c138dee70b86adc56db95f69a Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 8 Jul 2022 17:35:24 -0400 Subject: [PATCH] Load @sveltejs/vite-plugin-svelte conditionally --- packages/builder-vite/vite-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder-vite/vite-config.ts b/packages/builder-vite/vite-config.ts index 9554af91..db76cbda 100644 --- a/packages/builder-vite/vite-config.ts +++ b/packages/builder-vite/vite-config.ts @@ -2,7 +2,6 @@ import * as path from 'path'; import fs from 'fs'; import { Plugin } from 'vite'; import { TypescriptConfig } from '@storybook/core-common'; -import { loadSvelteConfig } from '@sveltejs/vite-plugin-svelte'; import viteReact from '@vitejs/plugin-react'; import { allowedEnvPrefix as envPrefix } from './envs'; @@ -146,6 +145,7 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig try { const csfPlugin = require('./svelte/csf-plugin').default; + const { loadSvelteConfig } = require('@sveltejs/vite-plugin-svelte'); const config = loadSvelteConfig(); plugins.push(csfPlugin({ ...config, ...svelteOptions })); } catch (err) {