prismicio / prismic-vue

Vue plugin, components, and composables to fetch and present Prismic content
https://prismic.io/docs/technologies/vuejs
Apache License 2.0
65 stars 16 forks source link

Instructions for importing directly within a component #47

Closed U3R1YXJ0 closed 2 years ago

U3R1YXJ0 commented 3 years ago

Rather than importing prismic-vue globally, I would like to import it only in the components that require getting and rendering prismic data in order to avoid increasing my vendor webchunk size unnecessarily. Could be a good addition to the readme?

lihbr commented 3 years ago

Hey @U3R1YXJ0, thanks for your suggestion! We'll consider that!

Right now you can use the kit components without using the whole plugin. That's what we're doing on the Nuxt module.

I guess what you could also do is creating a second Vue.js instance that you only import/use on your Prismic related pages. I would experiment that way.

lihbr commented 2 years ago

Technical references now document how to use components on their own 🎉 (in all fairness it's been some time since they do now)

Example: https://prismic.io/docs/technical-reference/prismicio-vue#prismicrichtext

Thank you for your contribution!