@storybook/addon-svelte-csf
Version:
Allows to write stories in Svelte syntax
18 lines (17 loc) • 619 B
JavaScript
import { transformPlugin, preTransformPlugin } from './compiler/plugins.js';
import { createIndexer } from './indexer/index.js';
export const viteFinal = async (config, options) => {
let { plugins = [], ...restConfig } = config;
const { legacyTemplate = false } = options;
if (legacyTemplate) {
plugins.unshift(await preTransformPlugin());
}
plugins.push(await transformPlugin());
return {
...restConfig,
plugins,
};
};
export const experimental_indexers = (indexers, options) => {
return [createIndexer(options.legacyTemplate ?? false), ...(indexers || [])];
};