contentlayerdev / contentlayerdev/contentlayer

MDX and edge function size limit

Đang mở
#339 2 bình luận 5 reaction 0 người được giao Xem trên GitHub
meta: never-stale needs-research
Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
192
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm using contentlayer with MDX for a blog and it is working pretty well, but recently i would like to use it in a vercel edge function as well. Edge functions have a bundle size limit of 1mb, which is achieved quite quickly with contentlayer and MDX. I've written about the problem and my workaround [here](https://sdorra.dev/posts/2022-11-24-contentlayer-mdx-edge). It would be nice if some better solution would be backed into contentlayer.

A few possible solutions come to my mind.

1. Split the body from the rest of the content and load it on demand with an async function on the entity
2. Option to create a separate collection of the entity without body
3. Hooks which makes it easy to write a separate collection without body on every change

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.