Skip to content

Ability to exclude files from compilation #10344

Open
@NatoBoram

Description

@NatoBoram

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionNot sure if we want to do this yet, also design work needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions