Skip to content

Commit 9f75bf2

Browse files
authored
Merge pull request #5 from openscript-ch/chore/enhance-vite-storybook-config
chore: enhance vite and storybook config
2 parents 19dabca + 1972e3b commit 9f75bf2

File tree

5 files changed

+15649
-11234
lines changed

5 files changed

+15649
-11234
lines changed

.storybook/main.js

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
1-
const react = require('@vitejs/plugin-react');
21
module.exports = {
32
stories: ['../stories/*.mdx', '../src/**/*.stories.tsx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
43
staticDirs: ['../docs'],
54
addons: [
5+
'@storybook/addon-links',
66
{
7-
name: '@storybook/addon-docs',
8-
options: {
9-
configureJSX: true,
10-
transcludeMarkdown: true,
11-
},
7+
name: '@storybook/addon-essentials', options: {
8+
docs: {
9+
configureJSX: true,
10+
transcludeMarkdown: true,
11+
}
12+
}
1213
},
13-
'@storybook/addon-links',
14-
'@storybook/addon-essentials',
1514
'@storybook/addon-storysource',
1615
],
17-
async viteFinal(config, { configType }) {
18-
config.plugins = config.plugins.filter((plugin) => !(Array.isArray(plugin) && plugin[0]?.name.includes('vite:react')));
19-
20-
config.plugins.push(
21-
react({
22-
exclude: [/\.stories\.(t|j)sx?$/, /node_modules/],
23-
}),
24-
);
25-
if (configType === 'PRODUCTION') {
26-
return {
27-
...config,
28-
base: './',
29-
};
30-
}
31-
return config;
16+
core: {
17+
builder: '@storybook/builder-vite',
3218
},
3319
framework: {
3420
name: '@storybook/react-vite',
35-
options: {},
36-
},
37-
docs: {
38-
docsPage: 'automatic',
3921
},
4022
};

0 commit comments

Comments
 (0)