Skip to content

Support for ESM configs #29

Closed
Closed
@dummdidumm

Description

@dummdidumm

Describe the feature
Support loading ESM config files. Currently only CommonJS svelte.config files are supported because the code uses require to load it.

I think that this line needs to change to use import(..) . Note though that TS will transpile this to a require anyway, that's why you need to create a const dynamicImport = new Function('path', 'return import(path)'); function and use that one as a workaround (see microsoft/TypeScript#43329 for more info).

A Usecase
Support ESM svelte.config.js in SvelteKit

Alternatives
none

Additional context
Blocker for sveltejs/kit#936

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions