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

fix: use module field as esm hint for bundlers #51

Merged
merged 1 commit into from
May 25, 2020

Conversation

fallenoak
Copy link
Member

@fallenoak fallenoak commented May 25, 2020

This should ensure webpack and other bundlers prefer the esm version of the code.

Entrypoints by environment:

  • Node.js in cjs mode: ambiguous main dist/index resolves to dist/index.js
  • Node.js in legacy esm mode: ambiguous main dist/index resolves to dist/index.mjs
  • Node.js in modern esm mode: exports.import resolves to dist/index.mjs
  • webpack: module resolves to dist/index.mjs

@fallenoak fallenoak requested a review from timkurvers May 25, 2020 04:27
@fallenoak fallenoak self-assigned this May 25, 2020
@codecov
Copy link

codecov bot commented May 25, 2020

Codecov Report

Merging #51 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #51   +/-   ##
=======================================
  Coverage   97.79%   97.79%           
=======================================
  Files           6        6           
  Lines         634      634           
  Branches       79       79           
=======================================
  Hits          620      620           
  Misses         14       14           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d9fd6c...b5b9e55. Read the comment docs.

@fallenoak fallenoak merged commit 60720da into master May 25, 2020
@fallenoak fallenoak deleted the fix-use-module-field branch May 25, 2020 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant