From 939162645392c78697eda7f19f721e3ea34bbce0 Mon Sep 17 00:00:00 2001 From: Igor Machado Date: Tue, 26 May 2020 18:02:52 -0300 Subject: [PATCH] ready for v4.0 --- README.md | 8 ++++++++ package-lock.json | 15 ++++++++++----- package.json | 1 + webpack-es6.config.js | 20 ++++++++++++-------- webpack.config.js | 16 ++++++++-------- 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 79226cd..96081fe 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,18 @@ bx3.toString(10); // outputs '4' ### Install on web browser +Classic JS: ```html ``` +If you want as ES6 module: +```html + +``` + ```js csBigInteger = csbiginteger.csBigInteger; csFixed8 = csbiginteger.csFixed8; diff --git a/package-lock.json b/package-lock.json index c49c85e..6b421e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -609,6 +609,14 @@ "chalk": "^3.0.0" } }, + "@purtuga/esm-webpack-plugin": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@purtuga/esm-webpack-plugin/-/esm-webpack-plugin-1.2.1.tgz", + "integrity": "sha512-q17/jiGfDiJlgsiQ79tOQE2z4p8E1i0d4Ftvi9GqYB9mZCyWvWEY/EnXZxVbImBgFS6NgnhaEXGYJ19FtVpo8A==", + "requires": { + "webpack-sources": "^1.0.0" + } + }, "@sinonjs/commons": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz", @@ -5690,14 +5698,12 @@ "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==" }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-resolve": { "version": "0.5.3", @@ -7090,7 +7096,6 @@ "version": "1.4.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, "requires": { "source-list-map": "^2.0.0", "source-map": "~0.6.1" diff --git a/package.json b/package.json index 617de70..13b2ab8 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { + "@purtuga/esm-webpack-plugin": "^1.2.1", "bn.js": "^4.11.9" } } diff --git a/webpack-es6.config.js b/webpack-es6.config.js index efa090f..c2e6102 100644 --- a/webpack-es6.config.js +++ b/webpack-es6.config.js @@ -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() + ] } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index edb78c2..33b7026 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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' + } } \ No newline at end of file