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

feat: emit code in ES Module format #178

Merged
merged 4 commits into from Mar 27, 2019
Merged

Conversation

liuyuchenzh
Copy link
Contributor

Export the whole library in ES Module format as well so that bundlers like webpack, rollup and parcel can enable code splitting when import { usexxx } from "react-use".

currently only export in commonjs format

Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about emitting ES code into modules/ or esm/ folder? Instead of lib/es/.

@streamich
Copy link
Owner

#38

@liuyuchenzh
Copy link
Contributor Author

Personally prefer esm. Shall we shake hands on it?

@streamich
Copy link
Owner

@liuyuchenzh I think esm/ would be good.

Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please add to package.json

{
  "files": [
    "lib/",
    "esm/"
  ]
}

Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@streamich streamich merged commit 85205c1 into streamich:master Mar 27, 2019
@streamich streamich mentioned this pull request Mar 27, 2019
@streamich
Copy link
Owner

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants