Ability to exclude files from compilation
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
There are times when we need to exclude files from compilation. Here's some examples:
- An app might not have some routes in the PWA build, like
/admin, but it might have them in the SSR build - Some files can be problematic during compilations, like
+page.server.ts
At the moment, these files have to be manually removed before the build then put back afterwards. It's cumbersome.
Describe the proposed solution
In svelte.config.js, define a function that acts as a filter to source code files so we can ignore some files.
Alternatives considered
Right now, if you want to ignore some files, you have to straight up delete them.
find src/routes -name '+*.server.*' -delete
pnpm build
http-server ./build
git checkout -- 'src/routes/+*.server.*'
Importance
would make my life easier
Additional Information
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 with the proposed configuration in svelte.config.js and trace how source files under src/routes are selected during pnpm build. Check how files such as +page.server.ts are handled, then define the filter behavior so selected files can be excluded without deleting them; done means the build honors the configured exclusions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100