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

[Feature] Convert *individual package files* from CJS -> ESM #40

Closed
FredKSchott opened this issue Aug 12, 2020 · 3 comments
Closed

[Feature] Convert *individual package files* from CJS -> ESM #40

FredKSchott opened this issue Aug 12, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@FredKSchott
Copy link
Collaborator

FredKSchott commented Aug 12, 2020

Resolves #34 #30

We currently serve any package as ESM, and up-convert CJS packages to ESM. But, we don't currently convert individual CJS files to ESM. We originally didn't want to touch individual files that were referenced by path, since those imports are of a specific file. But, enough packages need that that I think it's better than the alternative.

Example: https://cdn.skypack.dev/-/ipfs-utils@v2.3.1-HvR3d8q0I8sVAZxXiKua/dist=es2020,mode=raw/src/env.js

@drwpow drwpow added the enhancement New feature or request label Sep 1, 2020
@drwpow
Copy link

drwpow commented Sep 3, 2020

Another package this would fix: webcomponents-loader (among hundreds of others, no doubt)

@snickell
Copy link

snickell commented Sep 8, 2020

I think one argument in favor of this, if it can be made to work reliably, is that the (proper) fix to upstream modules will often be a build change, which I find many upstream maintainers feel less that 100% comfortable applying a PR for, if they don't fully understand the build, or ESM. One of the reasons skypack is great is that hardly anyone actually groks webpack 😂

I suspect that Skypack is still too young to have "oh, that doesn't work on skypack, please apply this sometimes-hairy webpack change PR to fix your module pathway to properly work as ESM" fly with a lot of maintainers.

Ironically, as skypack builds momentuum it'll actually probably be easier to get upstreams to fix their packages..... but for now having a lot of common libraries importable may be worth holding nose for.

@drwpow
Copy link

drwpow commented Sep 30, 2020

This is live!

@drwpow drwpow closed this as completed Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants