Anvil/.storybook/main.ts

43 lines
893 B
TypeScript
Raw Normal View History

import { dirname, join, resolve } from 'node:path';
import type { StorybookConfig } from '@storybook/sveltekit';
import { mergeConfig } from 'vite';
const config: StorybookConfig = {
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.ts'],
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) {
const allowFiles = config.server?.fs?.allow || [];
const storyFiles = resolve('stories');
return mergeConfig(config, {
alias: {
...config.alias,
$lib: resolve('..', 'src', 'lib')
},
server: {
...config.server,
fs: {
...config.server?.fs,
allow: [...allowFiles, storyFiles]
}
}
});
}
};
export default config;