Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically generate & load (module) plugins #1

Closed
pimlie opened this issue Apr 20, 2020 · 5 comments
Closed

Automatically generate & load (module) plugins #1

pimlie opened this issue Apr 20, 2020 · 5 comments

Comments

@pimlie
Copy link

pimlie commented Apr 20, 2020

Eg if you use @nuxtjs/fontawesome icons in your components the plugin generated by that module should also be loaded in storybook

Ideas:

  • Support a config structure for modules so they can indicate themselves whether their plugins need to be loaded in storybook or not (but let the user be able to override that)
@farnabaz farnabaz reopened this Jul 29, 2020
@farnabaz
Copy link
Collaborator

This integrator is loading all nuxt plugins in the main.js. But there is no possibility for the user to filter or add new plugins.

@adamskeeled
Copy link

Hey @farnabaz ! That does seem to indeed load the nuxt modules plugins, but doesn't make them available in the Storybook scope. For example, if I have the @nuxt/vuetify module and wrap <v-app> around my stories, Storybook doesn't recognize that element making everything inside the component break. This currently only works if I add <v-app> inside the component itself and that doesn't seem reasonable to have

@farnabaz
Copy link
Collaborator

farnabaz commented Sep 2, 2020

That does seem to indeed load the nuxt modules plugins, but doesn't make them available.

Actually, nuxt modules are loaded by storybook runtime and are available in the Storybook. But for sure Storybook does not support all of the Nuxt features.

For example, if I have the @nuxt/vuetify module and wrap <v-app> around my stories, Storybook doesn't recognize that element making everything inside the component break.

<v-app> does not provide by @nuxt/vuetify and in a nuxt project, you have to put this tag inside your pages or simply in your layouts. Inside the storybook, pages and layouts do not render and these forces to wrap your stories with <v-app>.

@adamskeeled
Copy link

v-app doesn't get provided by the nuxt module itself, but it's provided by the Vuetify dependency in it. And it's possible to have vuetify inside the Storybook scope. I already tried it in a simple Storybook app (not using this module) where vuetify would get added inside Storybook via a global decorator where v-app then became available to use in stories

@rlam3
Copy link

rlam3 commented Sep 11, 2020

Is there a recommended approach on how to get font-awesome and nuxt storybook working together with tailwindcss? I'm looking for an example repo but don't seem to find this anywhere in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants