-
-
Notifications
You must be signed in to change notification settings - Fork 15
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: add module.exports
CJS syntax, add example with require
#87
fix: add module.exports
CJS syntax, add example with require
#87
Conversation
bundle
export to CJS syntax and add example with require
@aeworxet you need to fix tests |
I just tested with my local project and looks like you can do both:
in my code I can do const |
4ed7eae
to
2dd653e
Compare
Then I seem to have overengineered a bit. |
bundle
export to CJS syntax and add example with require
module.exports
CJS syntax, add example with require
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tested on my machine and I see:
exports.default = bundle;
// 'module.exports' is added to maintain backward compatibility with Node.js
// projects, that use CJS module system.
module.exports = bundle;
and it works for ESM and CJS 🚀
2dd653e
to
46e265b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two changes :)
@aeworxet please do not do
|
…ncapi#81) Co-authored-by: Maciej Urbańczyk <[email protected]> Co-authored-by: Lukasz Gornicki <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! :)
@derberg ping :) |
Summoning @Souvikns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
/rtm |
🎉 This PR is included in version 0.3.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR:
module.exports
CJS syntax, to maintain backward compatibility with Node.js projects that use CJS module system,Fixes #81