-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.ts
More file actions
26 lines (21 loc) · 778 Bytes
/
main.ts
File metadata and controls
26 lines (21 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { join, dirname } from 'path';
import { createRequire } from 'module';
import type { StorybookConfig } from '@storybook/react-vite';
import { withoutVitePlugins } from '@storybook/builder-vite';
const require = createRequire(import.meta.url);
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [getAbsolutePath('@storybook/addon-themes')],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
async viteFinal(config) {
config.plugins = await withoutVitePlugins(config.plugins, ['vite:dts']);
return config;
},
};
export default config;