vue-lazy-hydration
vue-lazy-hydration copied to clipboard
Question: exclude async components from init load
I use this package and it worked well with hydration and async componnets. But can i exclude some async components, from initial html scripts? I have NavBar with some only mobile and only desktop elements, but nuxt load all of them(hydration work as expected)
If you go to page link, you can see script /_nuxt/tutorial-lazy.js in ssr html, but component async
I know that vue-lazy-hydration not call it, check it in console.
For some components it work as expected(load only when trigger hydration)
This issue is more related to vue-server-renderer which Nuxt.js depends on. If an async script is used on the server when rendering the page, vue-server-renderer will automatically inject it into the HTML.
So you are looking for a way to tell vue-server-renderer to not automatically render some async scripts. This is being disscussed (since a long time 😄 ) in this issue and this PR