diff --git a/packages/graph2d/package.json b/packages/graph2d/package.json index 476566e..07ec046 100644 --- a/packages/graph2d/package.json +++ b/packages/graph2d/package.json @@ -5,8 +5,8 @@ "author": "Alex Couturon ", "homepage": "https://github.com/alexcode/vue2vis#readme", "license": "MIT", - "main": "dist/graph2d.cjs.js", - "module": "dist/graph2d.esm.js", + "main": "dist/graph2d.umd.min.js", + "module": "dist/graph2d.esm.min.js", "directories": { "lib": "lib", "test": "__tests__" @@ -47,6 +47,7 @@ "propagating-hammerjs": "^1.4.0", "rollup-plugin-node-externals": "^2.1.5", "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^5.3.0", "uuid": "^7.0.0" } } diff --git a/packages/graph2d/rollup.config.js b/packages/graph2d/rollup.config.js index d028e04..213f7f0 100644 --- a/packages/graph2d/rollup.config.js +++ b/packages/graph2d/rollup.config.js @@ -2,15 +2,27 @@ import externals from "rollup-plugin-node-externals"; import resolve from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import nodePolyfills from "rollup-plugin-node-polyfills"; +import { terser } from "rollup-plugin-terser"; import vue from "rollup-plugin-vue"; export default [ { input: "./lib/index.js", - output: { - format: "esm", - file: "dist/graph2d.esm.js" - }, + output: [ + { + format: "esm", + sourcemap: true, + file: "dist/graph2d.esm.min.js" + }, + { + name: "vis", + extend: true, + exports: "named", + sourcemap: true, + format: "umd", + file: "dist/graph2d.umd.min.js" + } + ], plugins: [ externals({ exclude: [ @@ -28,30 +40,9 @@ export default [ uuid: ["v4"] } }), - vue() - ] - }, - { - input: "./lib/index.js", - output: { - format: "cjs", - file: "dist/graph2d.cjs.js" - }, - plugins: [ - externals({ - exclude: [ - "component-emitter", - "propagating-hammerjs", - "@egjs/hammerjs", - "keycharm", - "uuid" - ] - }), - nodePolyfills(), - resolve({ browser: true }), - commonjs({ - namedExports: { - uuid: ["v4"] + terser({ + output: { + comments: "some" } }), vue() diff --git a/packages/network/package.json b/packages/network/package.json index 8e049c3..8703d69 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -5,8 +5,8 @@ "author": "Alex Couturon ", "homepage": "https://github.com/alexcode/vue2vis#readme", "license": "MIT", - "main": "dist/network.cjs.js", - "module": "dist/network.esm.js", + "main": "dist/network.umd.min.js", + "module": "dist/network.esm.min.js", "directories": { "lib": "lib", "test": "__tests__" @@ -46,6 +46,7 @@ "keycharm": "^0.3.0", "rollup-plugin-node-externals": "^2.1.5", "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^5.3.0", "timsort": "^0.3.0", "uuid": "^7.0.0" } diff --git a/packages/network/rollup.config.js b/packages/network/rollup.config.js index b8ff106..ca9c0c0 100644 --- a/packages/network/rollup.config.js +++ b/packages/network/rollup.config.js @@ -2,15 +2,27 @@ import externals from "rollup-plugin-node-externals"; import resolve from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import nodePolyfills from "rollup-plugin-node-polyfills"; +import { terser } from "rollup-plugin-terser"; import vue from "rollup-plugin-vue"; export default [ { input: "./lib/index.js", - output: { - format: "esm", - file: "dist/network.esm.js" - }, + output: [ + { + format: "esm", + sourcemap: true, + file: "dist/network.esm.min.js" + }, + { + name: "vis", + extend: true, + exports: "named", + sourcemap: true, + format: "umd", + file: "dist/network.umd.min.js" + } + ], plugins: [ externals({ exclude: [ @@ -28,30 +40,9 @@ export default [ timsort: ["sort"] } }), - vue() - ] - }, - { - input: "./lib/index.js", - output: { - format: "cjs", - file: "dist/network.cjs.js" - }, - plugins: [ - externals({ - exclude: [ - "component-emitter", - "timsort", - "@egjs/hammerjs", - "keycharm", - "uuid" - ] - }), - nodePolyfills(), - resolve({ browser: true }), - commonjs({ - namedExports: { - timsort: ["sort"] + terser({ + output: { + comments: "some" } }), vue() diff --git a/packages/timeline/package.json b/packages/timeline/package.json index 0f646cf..af75975 100644 --- a/packages/timeline/package.json +++ b/packages/timeline/package.json @@ -5,8 +5,8 @@ "author": "Alex Couturon ", "homepage": "https://github.com/alexcode/vue2vis#readme", "license": "MIT", - "main": "dist/timeline.cjs.js", - "module": "dist/timeline.esm.js", + "main": "dist/timeline.umd.min.js", + "module": "dist/timeline.esm.min.js", "directories": { "lib": "lib", "test": "__tests__" @@ -54,6 +54,7 @@ "propagating-hammerjs": "^1.4.0", "rollup-plugin-node-externals": "^2.1.5", "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^5.3.0", "uuid": "^7.0.0" } } diff --git a/packages/timeline/rollup.config.js b/packages/timeline/rollup.config.js index 3b84024..29ef911 100644 --- a/packages/timeline/rollup.config.js +++ b/packages/timeline/rollup.config.js @@ -2,15 +2,27 @@ import externals from "rollup-plugin-node-externals"; import resolve from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import nodePolyfills from "rollup-plugin-node-polyfills"; +import { terser } from "rollup-plugin-terser"; import vue from "rollup-plugin-vue"; export default [ { input: "./lib/index.js", - output: { - format: "esm", - file: "dist/timeline.esm.js" - }, + output: [ + { + format: "esm", + sourcemap: true, + file: "dist/timeline.esm.min.js" + }, + { + name: "vis", + extend: true, + exports: "named", + sourcemap: true, + format: "umd", + file: "dist/timeline.umd.min.js" + } + ], plugins: [ externals({ exclude: [ @@ -28,30 +40,9 @@ export default [ uuid: ["v4"] } }), - vue() - ] - }, - { - input: "./lib/index.js", - output: { - format: "cjs", - file: "dist/timeline.cjs.js" - }, - plugins: [ - externals({ - exclude: [ - "component-emitter", - "propagating-hammerjs", - "@egjs/hammerjs", - "keycharm", - "uuid" - ] - }), - nodePolyfills(), - resolve({ browser: true }), - commonjs({ - namedExports: { - uuid: ["v4"] + terser({ + output: { + comments: "some" } }), vue() diff --git a/packages/utils/package.json b/packages/utils/package.json index 9bc5225..482bcb0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -5,8 +5,8 @@ "author": "Alex Couturon ", "homepage": "https://github.com/alexcode/vue2vis#readme", "license": "MIT", - "main": "dist/utils.cjs.js", - "module": "dist/utils.esm.js", + "main": "dist/utils.umd.min.js", + "module": "dist/utils.esm.min.js", "directories": { "lib": "lib", "test": "__tests__" @@ -39,6 +39,7 @@ "@rollup/plugin-node-resolve": "^7.1.1", "rollup-plugin-node-externals": "^2.1.5", "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-terser": "^5.3.0", "uuid": "^7.0.0" } } diff --git a/packages/utils/rollup.config.js b/packages/utils/rollup.config.js index 6da0f32..3056ca5 100644 --- a/packages/utils/rollup.config.js +++ b/packages/utils/rollup.config.js @@ -2,36 +2,38 @@ import externals from "rollup-plugin-node-externals"; import resolve from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import nodePolyfills from "rollup-plugin-node-polyfills"; +import { terser } from "rollup-plugin-terser"; export default [ { input: "./lib/index.js", - output: { - format: "esm", - file: "dist/utils.esm.js" - }, + output: [ + { + format: "esm", + sourcemap: true, + file: "dist/utils.esm.min.js" + }, + { + name: "vis", + extend: true, + exports: "named", + sourcemap: true, + format: "umd", + file: "dist/utils.umd.min.js" + } + ], plugins: [ externals({ exclude: ["uuid"] }), nodePolyfills(), resolve({ browser: true }), - commonjs() - ] - }, - { - input: "./lib/index.js", - output: { - format: "cjs", - file: "dist/utils.cjs.js" - }, - plugins: [ - externals({ - exclude: ["uuid"] - }), - nodePolyfills(), - resolve({ browser: true }), - commonjs() + commonjs(), + terser({ + output: { + comments: "some" + } + }) ] } ]; diff --git a/yarn.lock b/yarn.lock index a8c0ab9..bd5f052 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== @@ -4825,7 +4825,7 @@ debug@3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" -debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: +debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -5567,9 +5567,9 @@ eventemitter3@^3.1.0: integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== eventemitter3@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb" - integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg== + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== events@^3.0.0: version "3.1.0" @@ -6021,11 +6021,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.11.0.tgz#afa14f08ba12a52963140fe43212658897bc0ecb" - integrity sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA== - dependencies: - debug "^3.0.0" + version "1.13.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" + integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== for-in@^1.0.2: version "1.0.2" @@ -6770,9 +6768,9 @@ http-proxy-middleware@0.19.1: micromatch "^3.1.10" http-proxy@^1.17.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.0.tgz#dbe55f63e75a347db7f3d99974f2692a314a6a3a" - integrity sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ== + version "1.18.1" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" + integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== dependencies: eventemitter3 "^4.0.0" follow-redirects "^1.0.0" @@ -11229,6 +11227,17 @@ rollup-plugin-node-polyfills@^0.2.1: dependencies: rollup-plugin-inject "^3.0.0" +rollup-plugin-terser@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz#9c0dd33d5771df9630cd027d6a2559187f65885e" + integrity sha512-XGMJihTIO3eIBsVGq7jiNYOdDMb3pVxuzY0uhOE/FM4x/u9nQgr3+McsjzqBn3QfHIpNSZmFnpoKAwHBEcsT7g== + dependencies: + "@babel/code-frame" "^7.5.5" + jest-worker "^24.9.0" + rollup-pluginutils "^2.8.2" + serialize-javascript "^2.1.2" + terser "^4.6.2" + rollup-plugin-vue@^5.1.6: version "5.1.6" resolved "https://registry.yarnpkg.com/rollup-plugin-vue/-/rollup-plugin-vue-5.1.6.tgz#c0b31de919ff1aad36f3277957ac90345e897c23" @@ -11244,7 +11253,7 @@ rollup-plugin-vue@^5.1.6: source-map "0.7.3" vue-runtime-helpers "^1.1.1" -rollup-pluginutils@^2.4.1, rollup-pluginutils@^2.8.1: +rollup-pluginutils@^2.4.1, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== @@ -12244,7 +12253,7 @@ terser-webpack-plugin@^2.3.4: terser "^4.4.3" webpack-sources "^1.4.3" -terser@^4.1.2, terser@^4.4.3: +terser@^4.1.2, terser@^4.4.3, terser@^4.6.2: version "4.6.11" resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.11.tgz#12ff99fdd62a26de2a82f508515407eb6ccd8a9f" integrity sha512-76Ynm7OXUG5xhOpblhytE7X58oeNSmC8xnNhjWVo8CksHit0U0kO4hfNbPrrYwowLWFgM2n9L176VNx2QaHmtA==