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

Recent node versions can import ESModulesPackage output if "type": "module" is specified #936

Closed
wants to merge 0 commits into from

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Nov 17, 2020

With this change ESModulePackage can be imported by nodejs without getting raising SyntaxError about how the pkg directory is a CommonJS module

https://nodejs.org/api/packages.html#packages_determining_module_system

@vovacodes
Copy link

Can we merge it? "type": "module" is also a best practice for the browser-targeted packages that export code using esm format so that the modern bundlers can do a better job handling them. We should also include the "exports": "./<crate-name>.js" field (https://nodejs.org/api/packages.html#packages_exports_sugar)

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