chore(project): minify using terser

This commit is contained in:
Nico Rehwaldt 2019-07-31 13:03:32 +02:00
parent 32142b023a
commit 0b3cd452ca
3 changed files with 27 additions and 12 deletions

33
package-lock.json generated
View File

@ -1703,7 +1703,8 @@
"version": "2.17.1", "version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
"dev": true "dev": true,
"optional": true
}, },
"commenting": { "commenting": {
"version": "1.1.0", "version": "1.1.0",
@ -7616,16 +7617,28 @@
} }
} }
}, },
"rollup-plugin-uglify": { "rollup-plugin-terser": {
"version": "6.0.2", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.2.tgz", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.1.tgz",
"integrity": "sha512-qwz2Tryspn5QGtPUowq5oumKSxANKdrnfz7C0jm4lKxvRDsNe/hSGsB9FntUul7UeC4TsZEWKErVgE1qWSO0gw==", "integrity": "sha512-McIMCDEY8EU6Y839C09UopeRR56wXHGdvKKjlfiZG/GrP6wvZQ62u2ko/Xh1MNH2M9WDL+obAAHySljIZYCuPQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
"jest-worker": "^24.0.0", "jest-worker": "^24.6.0",
"serialize-javascript": "^1.6.1", "rollup-pluginutils": "^2.8.1",
"uglify-js": "^3.4.9" "serialize-javascript": "^1.7.0",
"terser": "^4.1.0"
},
"dependencies": {
"rollup-pluginutils": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz",
"integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==",
"dev": true,
"requires": {
"estree-walker": "^0.6.1"
}
}
} }
}, },
"rollup-pluginutils": { "rollup-pluginutils": {
@ -9083,6 +9096,7 @@
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",
"integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==",
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"commander": "~2.17.1", "commander": "~2.17.1",
"source-map": "~0.6.1" "source-map": "~0.6.1"
@ -9092,7 +9106,8 @@
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true "dev": true,
"optional": true
} }
} }
}, },

View File

@ -72,7 +72,7 @@
"rollup-plugin-license": "^0.9.0", "rollup-plugin-license": "^0.9.0",
"rollup-plugin-node-resolve": "^5.1.0", "rollup-plugin-node-resolve": "^5.1.0",
"rollup-plugin-replace": "^2.2.0", "rollup-plugin-replace": "^2.2.0",
"rollup-plugin-uglify": "^6.0.2", "rollup-plugin-terser": "^5.1.1",
"sinon": "^7.3.2", "sinon": "^7.3.2",
"sinon-chai": "^3.2.0", "sinon-chai": "^3.2.0",
"webpack": "^4.35.3" "webpack": "^4.35.3"

View File

@ -1,4 +1,4 @@
import { uglify } from 'rollup-plugin-uglify'; import { terser } from 'rollup-plugin-terser';
import nodeResolve from 'rollup-plugin-node-resolve'; import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json'; import json from 'rollup-plugin-json';
@ -56,7 +56,7 @@ const configs = distros.reduce(function(configs, distro) {
}, },
plugins: pgl([ plugins: pgl([
banner(output, true), banner(output, true),
uglify({ terser({
output: { output: {
comments: /license|@preserve/ comments: /license|@preserve/
} }