diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-13 23:01:42 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-13 23:01:42 +0100 |
commit | d951ebe070232d8e9d52c4c87d579639da472c0c (patch) | |
tree | a23d9c3f87abf579815113abc7ad3e030cbb39ca | |
parent | da6d34923608c646af0a692b235c329443fc1486 (diff) | |
download | svg.js-d951ebe070232d8e9d52c4c87d579639da472c0c.tar.gz svg.js-d951ebe070232d8e9d52c4c87d579639da472c0c.zip |
add rollup config to build polyfills
-rw-r--r-- | .config/polyfills.js | 27 | ||||
-rw-r--r-- | .config/rollup.polyfills.js | 20 | ||||
-rw-r--r-- | package-lock.json | 28 | ||||
-rw-r--r-- | package.json | 4 |
4 files changed, 53 insertions, 26 deletions
diff --git a/.config/polyfills.js b/.config/polyfills.js index d73adb8..fc7df3d 100644 --- a/.config/polyfills.js +++ b/.config/polyfills.js @@ -1,18 +1,9 @@ -import 'core-js/modules/es6.date.to-string'; -import 'core-js/modules/es6.function.name'; -import 'core-js/modules/es6.object.keys'; -import 'core-js/modules/es7.symbol.async-iterator'; -import 'core-js/modules/es6.symbol'; -import 'core-js/modules/es6.string.iterator'; -import 'core-js/modules/es6.set'; -import 'core-js/modules/es6.regexp.match'; -import 'core-js/modules/es7.array.includes'; -import 'core-js/modules/es6.string.includes'; -import 'core-js/modules/es6.array.iterator'; -import 'core-js/modules/es7.object.entries'; -import 'core-js/modules/es6.object.assign'; -import 'core-js/modules/es6.regexp.to-string'; -import 'core-js/modules/es6.regexp.replace'; -import 'core-js/modules/es6.regexp.split'; -import 'core-js/modules/web.dom.iterable'; -import 'core-js/modules/es6.array.find'; +import 'core-js/modules/es6.function.name' +import 'core-js/modules/es6.object.keys' +import 'core-js/modules/es6.symbol' +import 'core-js/modules/es6.set' +import 'core-js/modules/es7.array.includes' +import 'core-js/modules/es6.string.includes' +import 'core-js/modules/es6.array.iterator' +import 'core-js/modules/es7.object.entries' +import 'core-js/modules/es6.object.assign' diff --git a/.config/rollup.polyfills.js b/.config/rollup.polyfills.js new file mode 100644 index 0000000..94f0654 --- /dev/null +++ b/.config/rollup.polyfills.js @@ -0,0 +1,20 @@ +import { uglify } from "rollup-plugin-uglify" +import resolve from 'rollup-plugin-node-resolve' +import commonjs from 'rollup-plugin-commonjs' + +export default [ + { + input: './.config/polyfills.js', + output: { + file: 'dist/polyfills.js', + name: 'polyfills', + sourceMap: 'external', + format: 'iife' + }, + plugins: [ + resolve({browser: true}), + commonjs(), + uglify() + ] + } +] diff --git a/package-lock.json b/package-lock.json index d3fdb2e..8219a1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3654,12 +3654,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3674,17 +3676,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3801,7 +3806,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3813,6 +3819,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3827,6 +3834,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3834,12 +3842,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3858,6 +3868,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3938,7 +3949,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3950,6 +3962,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4071,6 +4084,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/package.json b/package.json index d418f07..10277f2 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,9 @@ "rollup": "rollup -c .config/rollup.config.js", "server": "npx http-server ./ -d", "test": "npx karma start .config/karma.conf.js", - "test:ci": "karma start .config/karma.conf.saucelabs.js" + "test:ci": "karma start .config/karma.conf.saucelabs.js", + "server": "npx http-server ./ -d", + "build:polyfills": "npx rollup -c .config/rollup.polyfills.js" }, "devDependencies": { "@babel/core": "^7.1.2", |