Closed omgitsjan closed 3 months ago
Alright, I've just come across the FAQ section "Why does my production build go up so much?" which explains the size increase due to server-side features and suggests disabling unused modules. This is quite helpful. I will proceed to disable the ogImage module as it seems to contribute significantly to the size increase.
I will leave this issue open for now, @harlan-zw, for you to decide. Perhaps some further optimization to the build size could still be beneficial if possible?
It's not possible to bring it down further as this is a direct result of the WASM's required to build OG images at runtime in a worker environment.
The only solution is to pretender the images or offload the image processing to a different server, which I do have some plans for in the future.
Hey @harlan-zw, How can I pre-render the images? I read in the documentation that I should use chromium renderer, but what about after that? There is any example I could follow?
Please follow https://github.com/nuxt-modules/og-image/issues/210#issuecomment-2109194076
You would then just use route rules to prerender whichever apply.
export default defineNuxtConfig({
routeRules: {
'/**': {
prerender: true
}
}
})
This is documented within Nuxt SEO, the solution is to disable Nuxt OG image or use nuxi generate
. I may improve the DX around this in the future but will close this for now.
If you'd like to discuss it further please make an issue on the https://github.com/nuxt-modules/og-image module.
Describe the bug
I am experiencing a significant increase in the package size when using the nuxt/seo package, which is preventing me from deploying my Nuxt.js application on Cloudflare. The size of the build increases drastically from 174kB to 2.02 MB (gzip) when the nuxt/seo package is added, compared to using the standard Nuxt.js configuration.
Steps to Reproduce
Expected Behavior
The addition of the nuxt/seo package should not significantly increase the build size, allowing for efficient deployment on platforms like Cloudflare.
System / Nuxt Info