Storybook (@storybook/web-components-vite) with Vite and vite-plugin-lwc #32359
-
SummaryI am attempting to run the latest version of Storybook (v9) with the Running the dev server works fine, but running the storybook build command causes the following issue:
There is a bit more context and info on the related discussion on the Also related vitejs/vite#20708 Additional informationNo response Create a reproduction |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @lukethacoder! I'm Dosu and I’m helping the storybook team. The build failure happens because the production build (using Rollup under Vite) tries to parse CSS in To fix this, you need to extend your Vite config using the Check the vite-plugin-lwc discussion for more context and possible plugin tweaks. If you need an example, the Storybook docs show how to use // .storybook/main.js
module.exports = {
// ...other config
async viteFinal(config, { configType }) {
// Add plugins or tweak config here
// Example: config.plugins.push(require('vite-plugin-static-copy')({ ... }))
return config;
},
}; Start by adding or adjusting asset plugins in To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Closing for now as this looks to be caused by issues with the |
Beta Was this translation helpful? Give feedback.
Closing for now as this looks to be caused by issues with the
vite-plugin-lwc
package. More info/discussions: cardoso/vite-plugin-lwc#95