Exclude pages from build
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
I have some devonly pages that I use to showcase project components and do general testing with.
I use
export const ssr = import.meta.env.DEV;
export const csr = import.meta.env.DEV;
to hide them from public view, but from my build output it seems that they still get built.
I haven't found a way for the pages to be excluded from the build.
Describe the proposed solution
Being able to exclude pages/layout groups from the build output with something like
export const exclude = true;
would be very nice.
Alternatives considered
No response
Importance
nice to have
Additional Information
Thank you for your consideration.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing SvelteKit's build handling for pages and layout groups, focusing on how the build output is generated. Define how an exclude setting should behave for pages and groups, then verify that excluded routes do not appear in the build output while normal routes still do.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100