Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jimmywarting
Copy link
Contributor

@jimmywarting jimmywarting commented Nov 10, 2021

You are not truly using ESM unless you are not specifying the extension.
you are compiling to commonjs after all...

remote http path resolver (like http-import) don't have access to the filesystem and can't resolve ./foo to ./foo.js or ./foo/index.js it's unable to guess what you meant

https://nodejs.org/docs/latest-v17.x/api/esm.html#mandatory-file-extensions

the only thing i think you have left to do is adding "type": "module" in package.json and stop generating cjs/umd and just output esm, but this is up to you - at least now this is more cdn friendly

@jimmywarting jimmywarting changed the title be explicit fix: explicit filepath Nov 10, 2021
@jimmywarting jimmywarting changed the title fix: explicit filepath fix: Explicit filepath Nov 10, 2021
@aearly aearly merged commit bb41f2a into caolan:master Nov 16, 2021
@aearly
Copy link
Collaborator

aearly commented Nov 16, 2021

Thanks. ESM support has changed out from underneath us since we did the initial switch to ESM.

@jimmywarting jimmywarting deleted the extension branch November 16, 2021 19:47
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

Successfully merging this pull request may close these issues.

2 participants