You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/builder-vite/README.md
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
3
3
Build your stories with [vite](https://vitejs.dev/) for fast startup times and near-instant HMR.
4
4
5
+
**Note:** This Repository is for Storybook 6.4 and 6.5. In Storybook 7, the Vite builder was brought into the main Storybook monorepo (https://github.com/storybookjs/storybook). See https://storybook.js.org/blog/first-class-vite-support-in-storybook/ for details.
6
+
5
7
# Table of Contents <!-- omit in toc -->
6
8
7
-
-[Migration from storybook-builder-vite](#migration-from-storybook-builder-vite)
8
9
-[Installation](#installation)
9
10
-[Usage](#usage)
10
11
-[Getting started with Vite and Storybook (on a new project)](#getting-started-with-vite-and-storybook-on-a-new-project)
@@ -15,29 +16,16 @@ Build your stories with [vite](https://vitejs.dev/) for fast startup times and n
15
16
-[React Docgen](#react-docgen)
16
17
-[Note about working directory](#note-about-working-directory)
17
18
-[Known issues](#known-issues)
19
+
-[Migration from storybook-builder-vite](#migration-from-storybook-builder-vite)
18
20
-[Contributing](#contributing)
19
21
-[About this codebase](#about-this-codebase)
20
22
21
-
## Migration from storybook-builder-vite
22
-
23
-
This project has moved from `storybook-builder-vite` to `@storybook/builder-vite` as part of a larger effort to improve Vite support in Storybook. To automatically migrate your existing project, you can run
24
-
25
-
```bash
26
-
npx sb@next automigrate
27
-
```
28
-
29
-
To manually migrate:
30
-
31
-
1. Remove `storybook-builder-vite` from your `package.json` dependencies
32
-
2. Install `@storybook/builder-vite`
33
-
3. Update your `core.builder` setting in `.storybook/main.js` to `@storybook/builder-vite`.
34
-
35
23
## Installation
36
24
37
25
Requirements:
38
26
39
27
- Vite 4.0 or newer (for Vite v3, use `@storybook/builder-vite@0.2.x`)
40
-
- Storybook 6.4.0 or newer (for storybook 6.3, use `storybook-builder-vite@0.1.16`)
28
+
- Storybook 6.4 or 6.5 (for storybook 7, see https://github.com/storybookjs/storybook/tree/next/code/lib/builder-vite)
41
29
42
30
```bash
43
31
npm install @storybook/builder-vite --save-dev
@@ -132,7 +120,9 @@ The function should return the updated Vite configuration.
132
120
133
121
### Svelte Customization
134
122
135
-
When using this builder with Svelte, your `.storybook/main.js` (or equivalent)
123
+
When using this builder with Svelte, your `svelte.config.js` file will be used automatically.
124
+
125
+
If you need to make overrides for Storybook, your `.storybook/main.js` (or equivalent)
136
126
can contain a `svelteOptions` object to pass custom options to
@@ -203,6 +193,20 @@ storybook configuration directory. This can be overridden in viteFinal.
203
193
204
194
- HMR: saving a story file does not hot-module-reload, a full reload happens instead. HMR works correctly when saving component files.
205
195
196
+
## Migration from storybook-builder-vite
197
+
198
+
This project has moved from `storybook-builder-vite` to `@storybook/builder-vite` as part of a larger effort to improve Vite support in Storybook. To automatically migrate your existing project, you can run
199
+
200
+
```bash
201
+
npx sb@next automigrate
202
+
```
203
+
204
+
To manually migrate:
205
+
206
+
1. Remove `storybook-builder-vite` from your `package.json` dependencies
207
+
2. Install `@storybook/builder-vite`
208
+
3. Update your `core.builder` setting in `.storybook/main.js` to `@storybook/builder-vite`.
0 commit comments