Skip to content

Support Vite 8 (Rolldown-powered) #33789

@valentinpalkovic

Description

@valentinpalkovic

Vite 8 is approaching stable release, powered by Rolldown (replacing Rollup + esbuild). This issue tracks the work to ensure Storybook is compatible with Vite 8.

Investigations

Peer dependency range

Extending the vite peer dependency to ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 across all Vite-based packages:

  • @storybook/builder-vite
  • @storybook/react-vite
  • @storybook/vue3-vite
  • @storybook/svelte-vite
  • @storybook/sveltekit
  • @storybook/nextjs-vite
  • @storybook/react-native-web-vite

build.rollupOptions -> build.rolldownOptions

Vite 8 renamed build.rollupOptions to build.rolldownOptions. The builder should detect the installed Vite major version at startup and uses the correct key. Backwards compatible with Vite 5-7.

Migration guide review

Storybook's Vite integration does not use any of the following deprecated/removed Vite 8 features, so no further changes are needed:

  • esbuild / optimizeDeps.esbuildOptions / transformWithEsbuild (now Oxc)
  • build.commonjsOptions / build.dynamicImportVarsOptions
  • resolve.alias[].customResolver
  • manualChunks / parseAst / parseAstAsync
  • Unsupported Rolldown hooks (shouldTransformCachedModule, resolveImportMeta, renderDynamicImport, resolveFileUrl)

References
Vite 8 Beta announcement
Vite 8 Migration guide

Sub-issues

Metadata

Metadata

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions