2024-02-08 10:43:55 +01:00
|
|
|
import { join, dirname } from 'node:path';
|
|
|
|
|
|
|
|
import type { StorybookConfig } from '@storybook/sveltekit';
|
|
|
|
import { mergeConfig } from 'vite';
|
|
|
|
|
|
|
|
const config: StorybookConfig = {
|
|
|
|
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
|
|
addons: [
|
|
|
|
'@storybook/addon-links',
|
|
|
|
'@storybook/addon-essentials',
|
|
|
|
'@storybook/addon-interactions'
|
|
|
|
],
|
|
|
|
core: {
|
|
|
|
builder: '@storybook/builder-vite'
|
|
|
|
},
|
|
|
|
framework: {
|
|
|
|
name: '@storybook/sveltekit',
|
|
|
|
options: {}
|
|
|
|
},
|
|
|
|
docs: {
|
|
|
|
autodocs: 'tag'
|
|
|
|
},
|
|
|
|
async viteFinal(config) {
|
|
|
|
return mergeConfig(config, {
|
|
|
|
server: {
|
|
|
|
...config.server,
|
|
|
|
fs: {
|
2024-02-08 10:56:03 +01:00
|
|
|
...config.server?.fs,
|
|
|
|
allow: [].concat(config.server?.fs?.allow || []).concat('stories')
|
2024-02-08 10:43:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
export default config;
|