Rafael Mendiola @raf.dev · Mar 13

Anybody a Storybook/Vite expert? I keep getting the require is not defined error. I understand why that's happening, but I have no idea how to configure Vite properly

2 likes 3 replies

?

Replies

Francois Ward · Mar 13

If the original source is require, add the vite-plugin-commonjs to the vite config that Storybook is using. Make sure you're not compiling the code with something else before storybook/vite touches it though

Jason Brown · Mar 13

Just use rsbuild! It's incredible