how can i tell the addon-vitest about a custom location of vitest.config.ts #31955
-
Summaryi want to move how can i pass an explicit location for Additional informationNo response Create a reproductionNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 viteFinal hook in main.ts, but this doesn’t let you specify a custom vitest config path—just merge config content as needed. This is a hard-coded limitation in the addon’s design right now (source). To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
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…