Closed
Description
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