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

Why the CJS in svelte.config.cjs? #1064

Closed
janosh opened this issue Apr 17, 2021 · 3 comments
Closed

Why the CJS in svelte.config.cjs? #1064

janosh opened this issue Apr 17, 2021 · 3 comments

Comments

@janosh
Copy link
Contributor

janosh commented Apr 17, 2021

Why does svelte.config.cjs use CommonJS? Seems like a design that won't age well. It also prevents sharing logic between the dev and build steps. Can't every file in a project of "type": "module" use ES modules?

@GrygrFlzr
Copy link
Member

This was a limitation of language tools and VS Code, not a deliberate decision. Work is already done to support ESM config files with sveltejs/language-tools#930 (feat) support ESM configs, but we're playing it safe for the moment and seeing if there are any bugs with the language tools update before we swap SvelteKit's config over to ESM.

@Conduitry
Copy link
Member

It was a limitation of the language server used in editor tooling I believe. Part of this has been resolved, and I think the intention is to also accept ESM here before too long.

@dummdidumm
Copy link
Member

#936 will add support for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants