Environment
NA
Reproduction
NA
Describe the bug
Currently, any options set in vue.compilerOptions in nuxt.config are not passed to the Vue plugin during the Storybook setup (https://github.com/nuxt-modules/storybook/blob/main/packages/storybook-addon/src/preset.ts#L176-L184). This can result in a difference in rendering when rendering in Storybook and when rendering in dev server/production, reducing the effectiveness of Nuxt Storybook as a testing environment.
Additional context
Not passing the compiler options to the plugin may also cause things to break in Storybook. For example, if someone has set compilerOptions.delimiters, they would be using different delimiters than the default, and the Storybook Vue renderer would not know that, potentially rendering a plain string when it should be interpolated. And it would work perfectly normally in dev and production mode, creating more confusion as to why it wouldn't work only in Storybook.
I have attempted to set these options in .storybook/{main,preview}.ts via the setup function imported from @nuxtjs/storybook, but Vite just ends up throwing ERR_PACKAGE_PATH_NOT_EXPORTED if I try to do it in main.ts, and a Importing directly from module entry-point is not allowed if I do it in preview.ts. I ended up using viteFinal inside Storybook config in main.ts to replace the existing plugin with one that has the necessary compiler options passed to it.
Environment
NA
Reproduction
NA
Describe the bug
Currently, any options set in
vue.compilerOptionsinnuxt.configare not passed to the Vue plugin during the Storybook setup (https://github.com/nuxt-modules/storybook/blob/main/packages/storybook-addon/src/preset.ts#L176-L184). This can result in a difference in rendering when rendering in Storybook and when rendering in dev server/production, reducing the effectiveness of Nuxt Storybook as a testing environment.Additional context
Not passing the compiler options to the plugin may also cause things to break in Storybook. For example, if someone has set
compilerOptions.delimiters, they would be using different delimiters than the default, and the Storybook Vue renderer would not know that, potentially rendering a plain string when it should be interpolated. And it would work perfectly normally in dev and production mode, creating more confusion as to why it wouldn't work only in Storybook.I have attempted to set these options in
.storybook/{main,preview}.tsvia thesetupfunction imported from@nuxtjs/storybook, but Vite just ends up throwingERR_PACKAGE_PATH_NOT_EXPORTEDif I try to do it inmain.ts, and aImporting directly from module entry-point is not allowedif I do it inpreview.ts. I ended up usingviteFinalinside Storybook config inmain.tsto replace the existing plugin with one that has the necessary compiler options passed to it.