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
And that is not going to be taken into account by the Vitest plugin. It's important because users might be loading certain scripts that impact on how components render/behave.
💡 Solutions/Action items:
Do nothing, acknowledge this limitation and have people move away from it or just accept it won't be present
Make the vitest plugin smart and use the [transformIndexHtml](https://vite.dev/guide/api-plugin#transformindexhtml) plugin hook internally (the code below is not what users would have to do, I'm just showing how to do it in user land. This would be done as part of the vitest plugin instead):
// vitest.config.tsimport{defineWorkspace}from'vitest/config'// hopefully something we can add internally via the storybook test pluginconstpreviewHeadPlugin=(previewHead)=>{return{name: 'storybook-preview-head-injection',transformIndexHtml(html){returnhtml.replace('</head>',`${previewHead}</head>`)},}}exportdefaultdefineWorkspace([{extends: '.storybook/vite.config.ts',plugins: [storybookTest(),// this would happen internally 👇previewHeadPlugin(` <style> body { background: yellow !important; } </style>`),}]// ... }])
The text was updated successfully, but these errors were encountered:
Users can define a custom
previewHead
orpreviewBody
script in main.js like soAnd that is not going to be taken into account by the Vitest plugin. It's important because users might be loading certain scripts that impact on how components render/behave.
💡 Solutions/Action items:
Do nothing, acknowledge this limitation and have people move away from it or just accept it won't be present
Make the vitest plugin smart and use the [transformIndexHtml](https://vite.dev/guide/api-plugin#transformindexhtml) plugin hook internally (the code below is not what users would have to do, I'm just showing how to do it in user land. This would be done as part of the vitest plugin instead):
The text was updated successfully, but these errors were encountered: