@storybook/builder-vite 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -18
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -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
|
-
- Vite
|
|
40
|
-
- Storybook 6.4
|
|
27
|
+
- Vite 4.0 or newer (for Vite v3, use `@storybook/builder-vite@0.2.x`)
|
|
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
|
|
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
|
|
137
127
|
[`vite-plugin-svelte`](https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/vite-plugin-svelte):
|
|
138
128
|
|
|
@@ -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`.
|
|
209
|
+
|
|
206
210
|
## Contributing
|
|
207
211
|
|
|
208
212
|
The Vite builder cannot build itself.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A plugin to run and build Storybooks with Vite",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"lint:eslint": "eslint \"**/*.{ts,tsx,js,jsx,mjs,cjs}\" --fix",
|
|
22
22
|
"lint-ci": "yarn lint-ci:prettier && yarn lint-ci:eslint",
|
|
23
23
|
"lint-ci:prettier": "prettier . --check",
|
|
24
|
-
"lint-ci:eslint": "eslint \"**/*.{ts,tsx,js,jsx,mjs,cjs}\" --max-warnings=0"
|
|
24
|
+
"lint-ci:eslint": "eslint \"**/*.{ts,tsx,js,jsx,mjs,cjs}\" --max-warnings=0",
|
|
25
|
+
"update-examples": "cd ../../examples/lit-ts && yarn && cd ../preact && yarn && cd ../react && cd ../react-18 && yarn && cd ../react-ts && yarn && cd ../svelte && yarn && cd ../vue2.6 && yarn && cd ../vue2.7 && yarn && cd ../vue3 && yarn && cd ../workspaces && yarn"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@joshwooding/vite-plugin-react-docgen-typescript": "0.
|
|
28
|
+
"@joshwooding/vite-plugin-react-docgen-typescript": "0.2.1",
|
|
28
29
|
"@storybook/core-common": "^6.4.3",
|
|
29
30
|
"@storybook/mdx1-csf": "^0.0.4",
|
|
30
31
|
"@storybook/node-logger": "^6.4.3",
|
|
@@ -61,9 +62,9 @@
|
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
64
|
"@storybook/mdx2-csf": "^0.0.3",
|
|
64
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
65
|
-
"@vitejs/plugin-vue": "^
|
|
66
|
-
"vite": ">=
|
|
65
|
+
"@sveltejs/vite-plugin-svelte": "^2.0.0",
|
|
66
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
67
|
+
"vite": ">= 4.0.0",
|
|
67
68
|
"vue-docgen-api": "^4.40.0"
|
|
68
69
|
},
|
|
69
70
|
"peerDependenciesMeta": {
|