-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.ts
39 lines (37 loc) · 1.1 KB
/
main.ts
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
27
28
29
30
31
32
33
34
35
36
37
38
39
import type { StorybookConfig } from '@storybook/react-vite';
import { dirname, join } from 'path';
import { mergeConfig } from 'vite';
/** @type { import('@storybook/html-vite').StorybookConfig } */
const config: StorybookConfig = {
stories: [
// TODO: remove this when every stories are migrated to `@osrd-project/storybook/stories/`
'../../**/src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-storysource'),
],
framework: getAbsolutePath('@storybook/react-vite'),
typescript: {
check: true,
},
docs: {
autodocs: 'tag',
},
staticDirs: ['../public'],
logLevel: 'debug',
async viteFinal(config) {
return mergeConfig(config, {
resolve: {
preserveSymlinks: true,
},
});
},
};
export default config;
function getAbsolutePath(value: string): string {
return dirname(require.resolve(join(value, 'package.json')));
}