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

Add a named commonjs export for Big #85

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

googol
Copy link
Contributor

@googol googol commented Sep 12, 2017

This enables the proper use of the module with es6 module syntax.

With just module.exports = Big, there is no proper way of importing it in a project using es6 module syntax. This is because the es6 import syntax doesn't allow direct access to the exports object.

This can be worked around when importing directly into a project that is transpiled into commonjs, but if you want to create a library that uses the es6 module syntax (to allow for tree shaking etc), those tricks are not usable anymore.

With the named export the old var Big = require('big.js') still works, but the es6 import { Big } from 'big.js' also works.

This enables the proper use of the module with es6 module syntax.
@MikeMcl MikeMcl merged commit 9ca1591 into MikeMcl:master Sep 14, 2017
@MikeMcl
Copy link
Owner

MikeMcl commented Sep 14, 2017

Okay, thanks.

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