mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
26 lines
1.5 KiB
Plaintext
26 lines
1.5 KiB
Plaintext
- Add the `--type svelte` flag to the installation command to set up Storybook manually:
|
|
|
|
```shell
|
|
npx storybook init --type svelte
|
|
```
|
|
|
|
- Storybook's CLI provides support for [Yarn](https://yarnpkg.com/), [npm](https://www.npmjs.com/), and [pnpm](https://pnpm.io/) package managers. If you have Yarn installed in your environment but prefer to use another as your default package manager add the `--package-manager` flag to your installation command. For example:
|
|
|
|
```shell
|
|
npx storybook init --package-manager=npm
|
|
```
|
|
|
|
### Svelte Native
|
|
|
|
To enable support for Svelte Native story format you'll need to make the following changes your Storybook configuration:
|
|
- Add the [`@storybook/addon-svelte-csf`](https://storybook.js.org/addons/@storybook/addon-svelte-csf/) addon as development dependency.
|
|
- Enable the addon in your Storybook configuration file (e.g., `.storybook/main.js`).
|
|
- Disable on demand story loading configuration property (e.g., `storyStoreV7`) in your Storybook configuration file.
|
|
- For issues with Svelte Native Story Format, check the [Svelte Story Format addon repository](https://github.com/storybookjs/addon-svelte-csf) for instructions.
|
|
|
|
|
|
- For other installation issues, check the Svelte README files for additional instructions:
|
|
- [Svelte with Webpack](https://github.com/storybookjs/storybook/tree/next/code/frameworks/svelte-webpack5)
|
|
- [Svelte with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/svelte-vite)
|
|
- [SvelteKit](https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit)
|