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

Ability to exclude files from compilation #10344

Open
NatoBoram opened this issue Jul 7, 2023 · 1 comment
Open

Ability to exclude files from compilation #10344

NatoBoram opened this issue Jul 7, 2023 · 1 comment
Labels
needs-decision Not sure if we want to do this yet, also design work needed

Comments

@NatoBoram
Copy link

NatoBoram commented Jul 7, 2023

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

@dummdidumm dummdidumm added the needs-decision Not sure if we want to do this yet, also design work needed label Jul 7, 2023
@dummdidumm
Copy link
Member

A more general solution would probably be some sort of plugin system where people can influence routes, and that could be done through that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Not sure if we want to do this yet, also design work needed
Projects
None yet
Development

No branches or pull requests

2 participants