Skip to content

support svelte.config.ts #5867

@Tal500

Description

@Tal500

Describe the problem

I think that SvelteKit should accept configuration also via typescript, by svelte.config.ts and not just svelte.config.js. For example, vite.config.ts file is already supported by Vite.

This is not only for "fancy" typescript support, I know that many of you will tell me to use JSDoc instead for simple config.
The real reason it's useful (or the real pain otherwise) is for allowing the config file load other typescript files for a computation in the svelte config file.

Describe the proposed solution

Load svelte.config.ts by SvelteKit, whenever svelte.config.js isn't found.
Loading is either via ts-node, or by compiling it to JS internally first, need to see how Vite and Playwright had achieved this.

Alternatives considered

For doing so you need to compile these typescript files before, and then load them to the svelte.config.js file.
This is so bad for automation, and also results with compiled *.js files in the working dir.

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions