Convert everything to ESM
See original GitHub issueModules are now fully supported in Node, except in Node 10 which will fall out of LTS very soon (the current ‘active’ LTS version is 14).
It makes sense, I think, for SvelteKit to fully embrace ESM, by which I mean that the CLI should be distributed as ESM, and that svelte.config.js
and snowpack.config.js
should be ESM.
There is a practical benefit to this, aside from making everything new and shiny and futureproof: it means that you can trivially share modules between the app you’re building and e.g. npm run
scripts. (We’ve encountered this at the NYT — we have a decompress
module that is primarily used in the client to calculate things like rolling averages, which don’t need to come over the wire, but which are also needed script-side to generate some summary data files.)
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (14 by maintainers)
Top GitHub Comments
If I remember correctly, only with the
--experimental-modules
flag.The interop is fine — you can
import foo from './foo.cjs'
in an ESM project and it will Do The Right Thing. So that seems viable