storybook-vue / storybook-nuxt

Deprecated in favor of https://github.com/nuxt-modules/storybook/
https://github.com/nuxt-modules/storybook/
132 stars 20 forks source link

fix: change builddir #100

Closed huang-julien closed 7 months ago

huang-julien commented 7 months ago

Hi :wave:

This PR change overrides the buildDir. The reason is that when using @nuxtjs/storybook, 2 nuxt server are started (almost at the same time) and the main one can conflict with the build started by storybook-nuxt because storybook-nuxt will likely delete and re-write the .nuxt build directory.

This PR can probably be improved by allowing to change the arguments sent to loadNuxt() and then letting @nuxt/storybook assign another buildDir itself.

baixiaoyu2997 commented 7 months ago

don't know if this is related, I encountered a strange problem, it only happened on vercel, after I storybook build, even though I set the output directory on vercel to storybook-static, vercel still started Files in the .vercel/output/static directory

tobiasdiez commented 7 months ago

The nuxt test-utils module puts everything in a subfolder under .nuxt, which has the advantage that it its git-ignored for most people, see https://github.com/nuxt/test-utils/blob/ba1fa2d91bd7db6102af9c3a7048745189f39086/src/core/nuxt.ts#L47-L55.

The same code also sets the root directory and the nitro output folder. The purpose of these changes is not totally clear to me - perhaps this fixes the issue mentioned by @baixiaoyu2997?