Skip to content

how can i tell the addon-vitest about a custom location of vitest.config.ts #31955

Answered by dosubot bot
stefanprobst asked this question in Help
Discussion options

You must be logged in to vote

Hi @stefanprobst! I'm Dosu and I’m helping the storybook team.

@storybook/addon-vitest does not currently support specifying a custom path for vitest.config.ts. It searches for vitest.config.* files starting from the current working directory up to the project root, and there’s no option to override this behavior or point it to a different location like config/vitest.config.ts. The only user-configurable directory is the Storybook configDir, not the Vitest config file location.

If you want to keep your config out of the root, a common workaround is to symlink or duplicate vitest.config.ts at the root. For advanced setups, you can manually merge your Vite plugins and aliases in the viteFi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stefanprobst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant