nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.12k stars 623 forks source link

NITRO_PRESET=vercel-edge build output is too large with 2.8.3+ #2439

Closed yyyanghj closed 1 month ago

yyyanghj commented 11 months ago

Environment

Reproduction

https://github.com/yyyanghj/nuxt-3-7-4

Describe the bug

Vercel hobby plan has 1MB(gzip) limit size for the edge function. The minimal production build output size is 1.6+ MB(gzip).

2.8.3

1.66 MB gzip

ℹ Building Nitro Server (preset: vercel-edge)                                                       nitro 4:47:44 AM
✔ Nitro server built                                                                                nitro 4:48:06 AM
  └─ .vercel/output/functions/__nitro.func/index.mjs (7.91 MB) (1.66 MB gzip)
Σ Total size: 7.91 MB (1.66 MB gzip)

2.8.2

516 kB gzip

ℹ Building Nitro Server (preset: vercel-edge)                                                       nitro 4:46:52 AM
✔ Nitro server built                                                                                nitro 4:47:08 AM
  └─ .vercel/output/functions/__nitro.func/index.mjs (1.92 MB) (516 kB gzip)
Σ Total size: 1.92 MB (516 kB gzip)

Additional context

No response

Logs

No response

yyyanghj commented 11 months ago

related issue https://github.com/nuxt/content/issues/2422

PixsaOJ commented 10 months ago

Can anyone tell us which code actually affects this 1MB limit?

Is it just server/ folder or other back-end logic on pages too?

Peggy535 commented 7 months ago

Hey there, I was having the same issue this morning. I had a look in .vercel/output/functions/__nitro.func/index.mjs having run nuxi build and I had about 10 SVG components that I had made into server components. Not sure why I did that tbh??? I must have been having a moment?? Anyways, I removed the server prefix and this reduce the output file for vercel_edge preset from 1.03MB to around 560kB. Possibly have a look at the components directory & unused CSS?

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 30 days with no activity.