Skip to content

Commit a7601ce

Browse files
Updated Storybook main file
1 parent f39d60e commit a7601ce

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.storybook/main.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@ const config = {
44
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
55
addons: ['@storybook/addon-links', '@storybook/addon-docs'],
66
framework: {
7-
name: '@stencil/storybook-plugin',
7+
name: '@storybook/web-components-vite',
88
options: {},
99
},
10-
staticDirs: ['../dist/web-components'], // <-- important
11-
webpackFinal: async config => {
12-
config.resolve.alias = {
13-
...config.resolve.alias,
14-
'@dist': path.resolve(__dirname, '../dist'),
15-
};
16-
return config;
10+
managerHead: (head: string) => `
11+
${head}
12+
<base href="./" />
13+
`,
14+
previewHead: (head: string) => `
15+
${head}
16+
<base href="./" />
17+
<script type="module">
18+
import { defineCustomElements } from '../dist/web-components/index.js';
19+
defineCustomElements();
20+
</script>
21+
`,
22+
typescript: {
23+
check: false,
24+
reactDocgen: 'react-docgen-typescript',
25+
reactDocgenTypescriptOptions: {
26+
shouldExtractLiteralValuesFromEnum: true,
27+
propFilter: (prop: any) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
28+
},
1729
},
1830
};
1931

0 commit comments

Comments
 (0)