nitrojs / nitrojs/nitro

Disallow `prerender: true` route rule for route rules having `*`

Open
#1,856 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement types v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

(context: from chat with @JamieCurnow)

We only support prerender: true for static route rules and omit the rest. (source: https://github.com/unjs/nitro/blob/7a6c61dbd1453e7bef69f999d0325881f901e8f6/src/prerender.ts#L32)

Using typescript, could be nice to make it clear.

 routeRules: {
    '/**': { prerender: true }, // invalid
    '/blog/**': { prerender: true }, // invalid
    '/blog/test': { prerender: true }, // valid
  },

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/prerender.ts around line 32, where non-static route rules are currently omitted, and trace the TypeScript types used for routeRules. Confirm the behavior for wildcard and static examples in the issue, then run the relevant existing checks or tests. Done means wildcard prerender rules are rejected or clearly marked invalid while /blog/test remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.