sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

ESM support: allow usage in `type:"module"` packages #1800

Closed benmccann closed 3 years ago

benmccann commented 3 years ago

Inspired by discussion with @Conduitry in https://github.com/sveltejs/svelte/pull/6772#issuecomment-931517985

The goal of this PR would be to ease the migration path from Sapper to SvelteKit by allowing developers to convert their project to ESM as a first step independent of the rest of the migration to SvelteKit

benmccann commented 3 years ago

Thanks for the suggestions. I like those ideas and have updated it to match

Conduitry commented 3 years ago

Hmm, all the tests failing look like they're because lots of them don't have their own individual package.jsons. It would probably be easiest (and a little bit safer) to make the compiler just assume CJS if it doesn't see a package.json.