An Interest In:
Web News this Week
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
- March 14, 2024
January 13, 2022 06:12 am GMT
Original Link: https://dev.to/kiranojhanp/add-storybookjs-to-a-sveltekit-project-40n5
Add storybook.js to a sveltekit project
First Create a sveltekit project and initialize storybook.js
1. npm init svelte@next sb-svelte2. cd sb-svelte3. npm install4. npx sb@next init5. npm run storybook
Running storybook at this moment should give you error. Here are the steps for the fix:
- change
"type": "commonjs"
in package.json
rename
svelte.config.js
tosvelte.config.mjs
replace your
.storybook/main.js
with following code:
module.exports = { stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx|svelte)'], addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-svelte-csf'], framework: '@storybook/svelte', svelteOptions: { preprocess: import('../svelte.config.mjs').preprocess }};
Original Link: https://dev.to/kiranojhanp/add-storybookjs-to-a-sveltekit-project-40n5
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To