From b1a4bce3d85a925de337a54a06e9b1f0befba3fd Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 12 Jun 2019 13:23:36 +0200 Subject: [PATCH] Upgrade to `uglify-js@3` --- gulpfile.js | 7 ++++-- package-lock.json | 54 +++++++++++++---------------------------------- package.json | 2 +- 3 files changed, 21 insertions(+), 42 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 50dbf61..a9662b9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -66,8 +66,11 @@ var compilerMinimalist = webpack({ }); function minify(name) { - var result = uglify.minify([DIST + '/' + name + '.js'], { - outSourceMap: name + '.map', + var code = String(fs.readFileSync(DIST + '/' + name + '.js')); + var result = uglify.minify(code, { + sourceMap: { + url: name + '.map' + }, output: { comments: /@license/, max_line_len: 64000 // extra large because we have embedded code for workers diff --git a/package-lock.json b/package-lock.json index 6c6da89..5877f21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -843,6 +843,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -5711,50 +5717,20 @@ "dev": true }, "uglify-js": { - "version": "2.8.22", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.22.tgz", - "integrity": "sha1-1Uk0d4qNoUkD+imjJvskwKtRoaA=", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "dev": true, "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" + "commander": "~2.20.0", + "source-map": "~0.6.1" }, "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "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 - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - } - }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } } } }, diff --git a/package.json b/package.json index 40b26e5..15bcee3 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "json-loader": "0.5.7", "mkdirp": "0.5.1", "mocha": "6.1.4", - "uglify-js": "2.8.22", + "uglify-js": "3.6.0", "webpack": "1.13.1" } }