Skip to content

Commit

Permalink
Load @sveltejs/vite-plugin-svelte conditionally (#434)
Browse files Browse the repository at this point in the history
It was being imported at the top of the file, which means for all frameworks.  Instead, this requires it conditionally only for svelte projects.
  • Loading branch information
IanVS authored Jul 8, 2022
1 parent 1c39672 commit 3cbcacd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/builder-vite/vite-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3cbcacd

Please sign in to comment.