Skip to content

Conversation

@koksyn
Copy link
Contributor

@koksyn koksyn commented Jan 11, 2019

For "Set up" section in documentation, there was a typo in import example for ES6.

"import Big from 'big.jms'"
instead of
"import Big from 'big.js'"

For "Set up" section in documentation, there was a typo in import example for ES6. 

"import Big from 'big.jms'" 
instead of 
"import Big from 'big.js'"
@MikeMcl
Copy link
Owner

MikeMcl commented Jan 11, 2019

The existing file extension is correct: big.mjs is the ES6 module version of big.js.

See, for example, the Node.js documentation:

The --experimental-modules flag can be used to enable features for loading ESM modules. Once this has been set, files ending with .mjs will be able to be loaded as ES Modules.

However, you are correct that there is a mistake - for the import to work in Node.js and browsers, it should be a relative path

import Big from './big.mjs';

If you update this PR accordingly, I will accept it.

@koksyn
Copy link
Contributor Author

koksyn commented Jan 12, 2019

Sorry for the confusion with the file extension. I didn't even know before that there are such experimental modules.

I restored the ".mjs" and changed the path to relative as you suggested.

@MikeMcl MikeMcl merged commit 565c0f8 into MikeMcl:master Jan 13, 2019
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