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

Simplify component imports #15

Open
jbmoelker opened this issue Jan 4, 2022 · 1 comment
Open

Simplify component imports #15

jbmoelker opened this issue Jan 4, 2022 · 1 comment

Comments

@jbmoelker
Copy link
Member

Can we enable simpler component imports?

Current implementation:

<script>
import PreviewModeBar from '@voorhoede/nuxt-preview-mode-module/lib/components/PreviewModeBar.vue';
import PreviewModeExitButton from '@voorhoede/nuxt-preview-mode-module/lib/components/PreviewModeExitButton.vue';

export default {
  components: { PreviewModeBar, PreviewModeExitButton },
};
</script>

Envisioned implementation:

<script>
import { PreviewModeBar, PreviewModeExitButton } from '@voorhoede/nuxt-preview-mode-module';

export default {
  components: { PreviewModeBar, PreviewModeExitButton },
};
</script>
@Frankwarnaar
Copy link
Contributor

I agree it would be ideal to export both the module (as default export) and the components would be named exports of the same file. However, the hard thing is the main export of the package is the nuxt module, which is loaded nuxt.config.js of the consuming package. To then be able to read the module file from the nuxt config, while also exporting vue components, nuxt config would have to be able to read vue files as well...

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

2 participants