module.exports = { // NOTE! added support for Vite builder webpackFinal: async (config) => { const svelteLoader = config.module.rules.find( (r) => r.loader && r.loader.includes('svelte-loader') ); svelteLoader.options.preprocess = require('svelte-preprocess')(); return config; }, core: { builder: 'storybook-builder-vite' }, stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx|svelte)'], addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-svelte-csf'], svelteOptions: { preprocess: require('svelte-preprocess')({ typescript: true, postcss: true, sourceMap: true }) } };