@storybook/builder-vite 8.6.14 → 10.0.4
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 +5 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9659 -43
- package/input/iframe.html +6 -3
- package/package.json +21 -26
- package/dist/index.mjs +0 -98
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ npx storybook@latest init --builder vite && npm run storybook
|
|
|
50
50
|
5. Remove Storybook Webpack cache (`rm -rf node_modules/.cache`)
|
|
51
51
|
6. Update your `/public/index.html` file for Vite (be sure there are no `%PUBLIC_URL%` inside it, which is a CRA variable)
|
|
52
52
|
7. Be sure that any files containing JSX syntax use a `.jsx` or `.tsx` file extension, which [Vite requires](https://vitejs.dev/guide/features.html#jsx). This includes `.storybook/preview.jsx` if it contains JSX syntax.
|
|
53
|
-
8.
|
|
53
|
+
8. For now you'll need to add a [workaround](https://github.com/storybookjs/storybook/issues/18399) for jest-mock relying on the node `global` variable by creating a `.storybook/preview-head.html` file containing the following:
|
|
54
54
|
|
|
55
55
|
```html
|
|
56
56
|
<script>
|
|
@@ -135,7 +135,7 @@ See [Customize Vite config](#customize-vite-config) for details about using `vit
|
|
|
135
135
|
|
|
136
136
|
### React Docgen
|
|
137
137
|
|
|
138
|
-
Docgen is used in Storybook to populate the props table in docs view, the controls panel, and for several other addons. Docgen is supported in Svelte, Vue 3, and React. React docgen is configurable via the [`typescript.reactDocgen`](https://storybook.js.org/docs/api/main-config-typescript#reactdocgen) setting in `.storybook/main.js`.
|
|
138
|
+
Docgen is used in Storybook to populate the props table in docs view, the controls panel, and for several other addons. Docgen is supported in Svelte, Vue 3, and React. React docgen is configurable via the [`typescript.reactDocgen`](https://storybook.js.org/docs/api/main-config-typescript#reactdocgen?ref=readme) setting in `.storybook/main.js`.
|
|
139
139
|
|
|
140
140
|
```javascript
|
|
141
141
|
export default {
|
|
@@ -151,7 +151,7 @@ If you're using TypeScript, we encourage you to experiment and see which option
|
|
|
151
151
|
|
|
152
152
|
The builder will by default enable Vite's [server.fs.strict](https://vitejs.dev/config/#server-fs-strict)
|
|
153
153
|
option, for increased security. The default project `root` is set to the parent directory of the
|
|
154
|
-
Storybook configuration directory. This can be overridden in [viteFinal](https://storybook.js.org/docs/api/main-config-vite-final).
|
|
154
|
+
Storybook configuration directory. This can be overridden in [viteFinal](https://storybook.js.org/docs/api/main-config-vite-final?ref=readme).
|
|
155
155
|
|
|
156
156
|
## Known issues
|
|
157
157
|
|
|
@@ -167,3 +167,5 @@ Have a look at the GitHub issues with the `vite` label for known bugs. If you fi
|
|
|
167
167
|
feel free to create an issue or send a pull request!
|
|
168
168
|
|
|
169
169
|
Please read the [How to contribute](/CONTRIBUTING.md) guide.
|
|
170
|
+
|
|
171
|
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type BuilderOptions = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/** Recursively removes all plugins with the names given Resolves async plugins */
|
|
18
|
-
declare const withoutVitePlugins: (plugins:
|
|
18
|
+
declare const withoutVitePlugins: <TPlugin>(plugins: TPlugin[] | undefined, namesToRemove: string[]) => Promise<TPlugin[]>;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Returns true if ANY of the plugins in the array have a name that matches one of the names in the
|
|
@@ -27,4 +27,4 @@ declare function bail(): Promise<void>;
|
|
|
27
27
|
declare const start: ViteBuilder['start'];
|
|
28
28
|
declare const build: ViteBuilder['build'];
|
|
29
29
|
|
|
30
|
-
export { BuilderOptions, StorybookConfigVite, ViteBuilder, ViteFinal, bail, build, hasVitePlugins, start, withoutVitePlugins };
|
|
30
|
+
export { type BuilderOptions, type StorybookConfigVite, type ViteBuilder, type ViteFinal, bail, build, hasVitePlugins, start, withoutVitePlugins };
|