Skip to content

Commit

Permalink
Change library type to umd and fully support ES6 module configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wbuss committed Feb 24, 2017
1 parent 1ee2767 commit e11cf5a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/JSONBigNumber.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "json-bignumber",
"version": "0.1.2",
"module": "dist/JSONBigNumber.min.js",
"version": "0.2.0",
"module": "src/JSONBigNumber.js",
"main": "dist/JSONBigNumber.min.js",
"scripts": {
"build": "webpack --colors",
Expand Down
7 changes: 6 additions & 1 deletion src/JSONBigNumber.js
Expand Up @@ -144,7 +144,7 @@
test, toJSON, toString, valueOf
*/

import BigNumber from "BigNumber";
import BigNumber from "bignumber.js";


var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
Expand Down Expand Up @@ -698,3 +698,8 @@ export function parse(source, reviver) {
}({"": result}, ""))
: result;
}

export default {
parse: parse,
stringify: stringify
};
9 changes: 7 additions & 2 deletions webpack.config.js
Expand Up @@ -7,10 +7,15 @@ module.exports = {
filename: "JSONBigNumber.min.js",
path: path.resolve(__dirname, "dist"),
library: "JSONBigNumber",
libraryTarget: "assign"
libraryTarget: "umd"
},
externals: {
"BigNumber": "BigNumber"
"bignumber.js" : {
commonjs: "bignumber.js",
commonjs2: "bignumber.js",
amd: "bignumber.js",
root: "BigNumber"
}
},
plugins: [
new webpack.optimize.UglifyJsPlugin()
Expand Down

0 comments on commit e11cf5a

Please sign in to comment.