contentlayerdev / contentlayerdev/contentlayer

MDX and edge function size limit

未关闭
#339 2 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
meta: never-stale needs-research
主要语言
TypeScript
星标
3.5k
派生
192
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

调研方向

从链接的 workaround 开始,检查 Contentlayer 当前如何为 edge-function bundle 生成 MDX 内容。比较提出的三种方案,然后定义并实现一个达成共识的解决方案,在保留对内容正文访问的同时,将 bundle 控制在 1 MB 限制以内。

由索引模型根据 Issue 内容生成。

评估

技术栈
markdown, typescript
领域
build-system, cloud
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。