From 821d04a78b130e12d76a2c915c1f0322db556b2d Mon Sep 17 00:00:00 2001 From: Christoph Oberhofer Date: Sat, 7 Jan 2017 23:58:14 +0100 Subject: [PATCH] Dependency updates; fixed uglyasm task for newer webpack versions --- package.json | 26 +++++++++++++------------- tasks/uglyasm.js | 8 +++----- webpack.config.min.js | 7 ++----- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 3b577cd..e858e20 100644 --- a/package.json +++ b/package.json @@ -7,16 +7,16 @@ "devDependencies": { "async": "^1.4.2", "babel-cli": "^6.5.1", - "babel-core": "^6.7.4", - "babel-eslint": "^6.0.0", + "babel-core": "^6.21.0", + "babel-eslint": "^7.1.1", "babel-istanbul-loader": "^0.1.0", - "babel-loader": "^6.2.4", - "babel-plugin-add-module-exports": "^0.1.2", + "babel-loader": "^6.2.10", + "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-check-es2015-constants": "^6.3.13", - "babel-plugin-lodash": "^2.2.1", + "babel-plugin-lodash": "^3.2.11", "babel-plugin-transform-es2015-arrow-functions": "^6.3.13", "babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13", - "babel-plugin-transform-es2015-block-scoping": "^6.3.13", + "babel-plugin-transform-es2015-block-scoping": "^6.21.0", "babel-plugin-transform-es2015-classes": "^6.3.13", "babel-plugin-transform-es2015-computed-properties": "^6.3.13", "babel-plugin-transform-es2015-destructuring": "^6.3.13", @@ -25,7 +25,7 @@ "babel-plugin-transform-es2015-literals": "^6.3.13", "babel-plugin-transform-es2015-modules-commonjs": "^6.3.13", "babel-plugin-transform-es2015-object-super": "^6.3.13", - "babel-plugin-transform-es2015-parameters": "^6.3.13", + "babel-plugin-transform-es2015-parameters": "^6.21.0", "babel-plugin-transform-es2015-shorthand-properties": "^6.3.13", "babel-plugin-transform-es2015-spread": "^6.3.13", "babel-plugin-transform-es2015-sticky-regex": "^6.3.13", @@ -33,10 +33,10 @@ "babel-plugin-transform-es2015-typeof-symbol": "^6.3.13", "babel-plugin-transform-es2015-unicode-regex": "^6.3.13", "babel-plugin-transform-object-rest-spread": "^6.5.0", - "babel-plugin-transform-regenerator": "^6.3.13", + "babel-plugin-transform-regenerator": "^6.21.0", "chai": "^3.4.1", - "core-js": "^1.2.1", - "cross-env": "^1.0.7", + "core-js": "^2.4.1", + "cross-env": "^3.1.4", "eslint": "^1.10.3", "grunt": "^0.4.5", "grunt-cli": "^0.1.13", @@ -59,8 +59,8 @@ "phantomjs": "^1.9.18", "sinon": "^1.16.1", "sinon-chai": "^2.8.0", - "webpack": "^2.1.0-beta.4", - "webpack-sources": "^0.1.1" + "webpack": "^2.2.0-rc.3", + "webpack-sources": "^0.1.3" }, "directories": { "doc": "doc" @@ -105,7 +105,7 @@ "gl-mat2": "^1.0.0", "gl-vec2": "^1.0.0", "gl-vec3": "^1.0.3", - "lodash": "^4.6.1", + "lodash": "^4.17.4", "ndarray": "^1.0.18", "ndarray-linear-interpolate": "^1.0.0", "webrtc-adapter": "^2.0.2" diff --git a/tasks/uglyasm.js b/tasks/uglyasm.js index 24e8f30..bd19683 100644 --- a/tasks/uglyasm.js +++ b/tasks/uglyasm.js @@ -10,9 +10,9 @@ module.exports = function(grunt) { grunt.registerTask('uglyasm', function() { var code = fs.readFileSync('dist/quagga.js', 'utf-8'), minifiedCode = fs.readFileSync('dist/quagga.min.js', 'utf-8'), - commentEnd = '/* @preserve ASM END */', - moduleFunctionRegex = /function\s*\((\w+,\s*\w+,\s*\w+)\)\s*\{\s*\/\* \@preserve ASM BEGIN \*\//, - commentStartIdx = code.indexOf("/* @preserve ASM BEGIN */"), + commentEnd = '@preserve ASM END', + moduleFunctionRegex = /function\s*\((\w+,\s*\w+,\s*\w+)\)\s*\{(\n?\s*\"use strict\";?)*\n?\/\*\s*\@preserve ASM BEGIN/, + commentStartIdx = code.indexOf("@preserve ASM BEGIN"), asmEndIdxTmp = code.indexOf(commentEnd), asmEndIdx = code.indexOf("}", asmEndIdxTmp), asmCodeTmp = code.substring(commentStartIdx - Math.min(500, commentStartIdx), @@ -30,8 +30,6 @@ module.exports = function(grunt) { .replace(/ ([+=^|&]|>+|<+) /g, '$1') // remove spaces around operators .replace(/[\r\n/]/g, ''); // remove new lines - grunt.log.debug(asmCodeMinified); - asmModule = moduleFunctionRegex.exec(asmCode); if (!asmModule) { grunt.log.error("No ASM module found"); diff --git a/webpack.config.min.js b/webpack.config.min.js index 4f4bfc9..72502fc 100644 --- a/webpack.config.min.js +++ b/webpack.config.min.js @@ -10,14 +10,11 @@ module.exports.plugins = module.exports.plugins.concat([ compress: { warnings: false }, - output: { - comments: /@preserve/ - }, sourceMap: false }), ]); module.exports.output.filename = 'quagga.min.js'; -module.exports.output.sourceMapFilename = null; -module.exports.devtool = null; +module.exports.output.sourceMapFilename = ''; +module.exports.devtool = false;