You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Storybook only reads env variables prefixed with STORYBOOK_ (and VITE_ for Vite projects), and if you want it to read more variables, you have to specify it in main.js
// .storybook/main.jsexportdefault{env: (config)=>({
...config,EXAMPLE_VAR: 'An environment variable configured in Storybook',}),};
In Vitest with the Storybook plugin, on the other hand, it only takes VITE_ variables into consideration. Also, it will not know about that extra env passed from main.js.
💡 Solutions/Action items:
Make the plugin handle STORYBOOK_ variables by default
Make the plugin smarter and merge the env config from main.js with the env config from Vitest
The text was updated successfully, but these errors were encountered:
By default, Storybook only reads env variables prefixed with
STORYBOOK_
(andVITE_
for Vite projects), and if you want it to read more variables, you have to specify it in main.jsIn Vitest with the Storybook plugin, on the other hand, it only takes
VITE_
variables into consideration. Also, it will not know about that extra env passed from main.js.💡 Solutions/Action items:
STORYBOOK_
variables by defaultenv
config from main.js with theenv
config from VitestThe text was updated successfully, but these errors were encountered: