diff --git a/CHANGELOG.md b/CHANGELOG.md index 4662d6a..778a369 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## version 4.x (dev) - In order to enforce standard with C#, C++ and other related projects, we will adopt string base16 constructor ALWAYS as BigEndian. This removes the "strange" difference between building "0001" and "0x0001" (the former was not usually ONE... now it will be). In basic words `0x` prefix will be optional for string base16. Unfortunately, this may break compatibility with someone out there, so we will increase a MAJOR. +- `npm run build` now puts two files in `dist/`: classic `csbiginteger.js` and `csbiginteger.mjs` (es6 module) ## version 3.x diff --git a/package.json b/package.json index bfb6ba7..617de70 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "./node_modules/.bin/jest --coverage", - "build": "./node_modules/.bin/webpack" + "build": "./node_modules/.bin/webpack --config webpack.config.js && ./node_modules/.bin/webpack --config webpack-es6.config.js" }, "repository": { "type": "git", diff --git a/webpack-es6.config.js b/webpack-es6.config.js new file mode 100644 index 0000000..efa090f --- /dev/null +++ b/webpack-es6.config.js @@ -0,0 +1,10 @@ +module.exports = { + mode: "production", + entry: "./index.js", + output: { + library: 'csbiginteger', + libraryTarget: 'var', + filename: './csbiginteger.mjs', + auxiliaryComment: 'csBigInteger.js library' + } +} \ No newline at end of file