Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many items generated in _route.json for cloudflare preset #2068

Open
Barbapapazes opened this issue Jan 10, 2024 · 2 comments · May be fixed by #2465
Open

Too many items generated in _route.json for cloudflare preset #2068

Barbapapazes opened this issue Jan 10, 2024 · 2 comments · May be fixed by #2465
Labels
bug Something isn't working preset:cloudflare

Comments

@Barbapapazes
Copy link
Member

Environment

/

Reproduction

Run playground from repo unsing

NITRO_PRESET=cloudflare_pages nr dev:build

Describe the bug

Actually, the preset use a glob to add every files from the public directory https://github.com/unjs/nitro/blob/main/src/presets/cloudflare-pages.ts#L113. This can easily generate more than 100 paths, limit from Cloudflare, https://developers.cloudflare.com/pages/functions/routing/#limits.

Could we add a flag to generate global path like '/assets/', '/images/' and so on?

related to nuxt-modules/og-image#77
related to unjs/website#228 (comment)

Additional context

No response

Logs

No response

@Barbapapazes Barbapapazes added bug Something isn't working preset:cloudflare labels Jan 10, 2024
@Brendonovich
Copy link

I've had this fixed on our fork for a while and it's been working well, I'll get it rebased on main and open a PR.

@Brendonovich Brendonovich linked a pull request May 24, 2024 that will close this issue
8 tasks
@pgraug
Copy link
Contributor

pgraug commented May 27, 2024

Hi! Sorry I missed this issue when making #2319.

If you add you own wildcard excludes to the config, Nitro already omits all paths matching that from being added again.
It's a little bit of manual work, but may avoid some of the possible edge-case complexity of auto-generating the wildcard excludes.

Either way more documentation of this would probably help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preset:cloudflare
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants