feat: migrate from webpack to vite in storybook#680
Conversation
|
03d1aa8 to
7e21c9b
Compare
There was a problem hiding this comment.
Pull request overview
Migrates @ima/storybook-integration from the old webpack-based Storybook integration to a Vite-based preset that reuses the new @ima/cli Vite pipeline. This keeps Storybook aligned with the codebase’s broader Vite migration while updating the integration’s docs, dependencies, and packaging.
Changes:
- Replace
webpackFinal/webpack resolver helpers with a newviteFinal+previewAnnotationspreset flow. - Reuse
@ima/cliVite config pieces, including virtual locale modules and injected$IMArevival settings. - Update Storybook package metadata, docs, and lockfile dependencies for the Vite-based setup.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/storybook-integration/tsconfig.json |
Removes webpack ambient types from the package TS config. |
packages/storybook-integration/src/types.ts |
Switches Storybook type imports/module augmentation to Storybook 10 internal types. |
packages/storybook-integration/src/presets/resolvers.ts |
Deletes webpack-specific resolver utilities. |
packages/storybook-integration/src/preset.ts |
Replaces webpack preset logic with Vite preset hooks and locale/HTML injection. |
packages/storybook-integration/src/loaders/imaLoader.ts |
Tightens cached IMA parameter typing and reload-key handling. |
packages/storybook-integration/README.md |
Rewrites setup instructions for Storybook + Vite usage. |
packages/storybook-integration/package.json |
Swaps webpack-related Storybook deps/peers for Vite-related ones. |
packages/storybook-integration/.npmignore |
Limits published contents to built artifacts. |
packages/plugin-cli/package.json |
Bumps direct rolldown dependency. |
packages/cli/src/index.ts |
Re-exports virtual locale helpers needed by Storybook integration. |
packages/cli/package.json |
Bumps Vite version used by the CLI. |
package.json |
Reorders workspace entries. |
package-lock.json |
Locks the Storybook/Vite/Rolldown dependency updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Prefers the explicit `language` option, falls back to the first language | ||
| * defined in imaConfig, then 'en'. | ||
| */ | ||
| function resolveLanguage( | ||
| imaConfig: Awaited<ReturnType<typeof resolveImaConfig>>, | ||
| options: Pick<ViteFinalOptions, 'language'> | ||
| ): string { | ||
| return options.language ?? Object.keys(imaConfig.languages ?? {})[0] ?? 'en'; |
| const oldEnv = process.env.NODE_ENV; | ||
| process.env.NODE_ENV = 'regression'; | ||
| const env = resolveEnvironment(rootDir); |
| ], | ||
| ``` | ||
|
|
||
| ### 4. Import the preview setup in `.storybook/preview.js` |
No description provided.