Distribute cms-components as nuxt layer? #34
Replies: 3 comments 1 reply
-
Sounds like a nice idea. Our intention is to keep the cms-base package standalone to the point that it's not only available for Nuxt projects, but also for plain Vue.js projects. If that allows us to keep the intention, I'd strongly advocate for the solution @niklaswolf proposed. |
Beta Was this translation helpful? Give feedback.
-
Hey @niklaswolf We're doing exactly that, but not via layers but via the Nuxt module.
And they are (and need to be all) in the final bundle because CMS content is generic and you don't know which of these components will be actually used during page render. Of course, they are lazy loaded so the actual size of the final page render is not having all of them and only needed components are used. Additionally, as @elkmod also mentioned - with CMS, composables and other packages we're aiming to allow them to work not only inside Nuxt. Either way, the end result is exactly the same. Let me know if you have more thoughts on that! |
Beta Was this translation helpful? Give feedback.
-
You're right, my bad, I just hovered over the
So are you really sure about this? |
Beta Was this translation helpful? Give feedback.
-
It seems like the nuxt 3 layers feature could be really cool to use with the CMS-components? https://nuxt.com/docs/getting-started/layers
It seems like this could be a good usecase, since it is explicitely mentioned:
which is basically what the CMS components are :)
Right now the components are all bundled in the composables-next package which is bundled into the main bundle of the app.
I can imagine that using the layers-feature the components could then end up lazy loaded? But I'm not sure about this.
Beta Was this translation helpful? Give feedback.
All reactions