Skip to content

Commit

Permalink
ready for v4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
igormcoelho committed May 26, 2020
1 parent 8426d28 commit 9391626
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ bx3.toString(10); // outputs '4'

### Install on web browser

Classic JS:
```html
<script src="https://unpkg.com/csbiginteger/dist/csbiginteger"></script>
```

If you want as ES6 module:
```html
<script type="module">
import csbiginteger from "https://unpkg.com/csbiginteger/dist/csbiginteger-es6";
</script>
```

```js
csBigInteger = csbiginteger.csBigInteger;
csFixed8 = csbiginteger.csFixed8;
Expand Down
15 changes: 10 additions & 5 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"webpack-cli": "^3.3.11"
},
"dependencies": {
"@purtuga/esm-webpack-plugin": "^1.2.1",
"bn.js": "^4.11.9"
}
}
20 changes: 12 additions & 8 deletions webpack-es6.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin");
module.exports = {
mode: "production",
entry: "./index.js",
output: {
library: 'csbiginteger',
libraryTarget: 'var',
filename: './csbiginteger.mjs',
auxiliaryComment: 'csBigInteger.js library'
}
mode: "production",
entry: "./index.js",
output: {
library: 'csbiginteger',
libraryTarget: 'var',
filename: './csbiginteger-es6.mjs',
auxiliaryComment: 'csBigInteger.js library (es6 module format)'
},
plugins: [
new EsmWebpackPlugin()
]
}
16 changes: 8 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
mode: "production",
entry: "./index.js",
output: {
library: 'csbiginteger',
libraryTarget: 'umd',
filename: './csbiginteger.js',
auxiliaryComment: 'csBigInteger.js library'
}
mode: "production",
entry: "./index.js",
output: {
library: 'csbiginteger',
libraryTarget: 'umd',
filename: './csbiginteger.js',
auxiliaryComment: 'csBigInteger.js library'
}
}

0 comments on commit 9391626

Please sign in to comment.