Open sosensible opened 1 year ago
Oh, link to the site... https://nuxtjs.org/
I also would like an official way to do all the nuxt magic in storybook without too many hacks
Oh, link to the site... https://nuxtjs.org/
They move the Nuxt 3 stuf to https://nuxt.com .
If some one have a hack
please share it here
I have figured out how to use @storybook/vue3 V6
with Nuxt 3 V3.0.0
, Follow these steps:
Before going through these steps, make sure to run
yarn install
ornpm ci
first!
npx storybook init --type vue3
(if you asked to Do you want to run the 'eslintPlugin' migration on your project? press Y
yarn add --dev @storybook/builder-vite
(if you using Vite
as your application bundlerpackage.json
scripts
, add the following:
"serve-storybook": "npx http-server ./storybook-static"
.storybook
main.js
file, extend module.exports
object with:
core: {
builder: '@storybook/builder-vite',
},
async viteFinal(config, { configType }) { if (configType === 'DEVELOPMENT') { return { ...config, define: { ...config.define, global: 'window', }, }; }
return config; },
5. Create `preview-head.html` file inside `.storybook` folder and add:
```html
<script>
var global = window
</script>
Introduction.stories.mdx
file from stories
folderNow, you can run yarn storybook
for development mode
& yarn build-storybook
for building your stories.
References:
Have you tried this? hirotaka/storybook-addon-nuxt
Is your feature request related to a problem? Please describe
Getting the advantage of doing Storyboard for Nuxt 3 (the new current version) and to be noted there was no official support for Nuxt 2 and back previously.
Describe the solution you'd like
Guide and proven path to doing everything awesome Storybook does with Nuxt 3 solutions.
Describe alternatives you've considered
Using Vue... not desperate enough to migrate to React. Not bad tech, it's just not Vue to our team.
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
We will help test and create examples. We are not Nuxt core team but will engage with all of the above, including posting online socially and training videos.