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

Nuxt Content & Nuxt Components #150

Closed
toddmorey opened this issue Jun 16, 2020 · 4 comments · Fixed by #164
Closed

Nuxt Content & Nuxt Components #150

toddmorey opened this issue Jun 16, 2020 · 4 comments · Fixed by #164
Labels
enhancement New feature or request

Comments

@toddmorey
Copy link

toddmorey commented Jun 16, 2020

Is there a way to have Nuxt Components auto import components that are referenced in the content files that Nuxt Content processes? If not, what's a good strategy for dynamically importing the components that may or may not be referenced in content files (.md files, etc)?

@atinux atinux added the enhancement New feature or request label Jun 17, 2020
@atinux
Copy link
Member

atinux commented Jun 17, 2020

Also related to #47

@benjamincanac
Copy link
Member

Hey @toddmorey,

A PR is currently ongoing to handle global components with @nuxt/components, so you will be able to put the components you use in Markdown by putting them in components/global.

@benjamincanac benjamincanac linked a pull request Jun 19, 2020 that will close this issue
@Spunkie
Copy link

Spunkie commented Jul 5, 2020

@benjamincanac Is there a code-splitting, perf, or other reason not to simply put all components under /components/global/ now?

@benjamincanac
Copy link
Member

@Spunkie In a general way I wouldn't put any component that uses subjacent libraries in global (gmaps.js, highlight.js, ...) but lazy load them instead.

Global components are meant to be components that are often used in your website, remember that global components are added to the global vendor bundle.

You can use nuxt build -a to see a map of your bundle.

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

Successfully merging a pull request may close this issue.

4 participants