Is it possible to generate pages without client side javascript code added (specially the 'window.__NUXT__ = ...' at the end)? I am working on a website where most pages don't have any user interaction, but still use complex server side rendering involving a lot of data. My served html pages get a lot bigger than they should because of the data added at the end in the __NUXT__
variable.
I wish there was a flag that would somehow tell nuxtjs that some pages should only use server side rendering. This would also make nuxtjs a nice alternative to jekyll, thanks to the generate command.
What about https://nuxtjs.org/guide/vuex-store/#the-nuxtserverinit-action ?
@xalioth: no, that is the same: the data put in the store ends up in the html window.__NUXT__
variable.
@alexchopin why is this issue closed? I think it's a relevant question. If the answer is NO that is also understandable I think. However, maybe you or someone has a workaround in that case?
@alexchopin I agree with @jbmoelker.
I even noticed that if I rename a generated file it will stop working if the client side scripts are still included. The page was rendered for a second then turned white.
But they will work as expected if the scripts are removed.
On my small example I counted 296.3KB (not GZipped) of JS that wasn't required to show the generated markup.
+1
Is it possible to have a completely JS-less page with nuxt?
Yup I'm also wondering?
upvote
I also have a project with a lot of static pages generated with nuxt. But none of this pages has JS functionality in some way, so I wondered the same thing, if it is possible to generate without the JS overhead added to the page? I just want this flexibility to use Nuxt at the one hand, but have more control over JS injected.
EDIT: I also found this issue with a potential solution to the problem. https://github.com/nuxt/nuxt.js/issues/2822#issuecomment-366527838
It's not overhead, it's underhead, @peckomingo.
@alexchopin Seems like a valid question, some people use Nuxt because developing things with is so simple.
we managed to fork out nuxt and add a simple parameter.. Looks like a hack, as it is, actually. Using nuxt.js as a static page generator
https://github.com/crello/nuxt.js/commit/93ea141ba563356c58e9b2c572dbe280021f164e
The only thing worse than an abundance of options is scope creep
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@alexchopin why is this issue closed? I think it's a relevant question. If the answer is NO that is also understandable I think. However, maybe you or someone has a workaround in that case?