-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aksel.nav.no] Storybook: Change to Vite framework #3185
Conversation
|
}, | ||
webpackFinal: (async (config) => { | ||
if (!config?.resolve) { | ||
return config; | ||
} | ||
config.resolve.plugins = [ | ||
new TsconfigPathsPlugin({ | ||
configFile: resolve(__dirname, "../tsconfig.json"), | ||
}), | ||
]; | ||
return config; | ||
}) satisfies StorybookConfig["webpackFinal"], | ||
viteFinal: async (config) => { | ||
const { mergeConfig } = await import("vite"); | ||
return mergeConfig(config, { plugins: [TsconfigPathsPlugin()] }); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩 Fewer lines is always better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩 🤩 🤩 🤩
Works on my machine, from ~19 sec startup to ~6 sec ⚡
Changed to the new experimental Next.js/Vite framework for Storybook, which is faster than webpack.
https://storybook.js.org/docs/get-started/frameworks/nextjs?ref=storybookblog.ghost.io#with-vite