mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Dependency updates; fixed uglyasm task for newer webpack versions
This commit is contained in:
+13
-13
@@ -7,16 +7,16 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"async": "^1.4.2",
|
"async": "^1.4.2",
|
||||||
"babel-cli": "^6.5.1",
|
"babel-cli": "^6.5.1",
|
||||||
"babel-core": "^6.7.4",
|
"babel-core": "^6.21.0",
|
||||||
"babel-eslint": "^6.0.0",
|
"babel-eslint": "^7.1.1",
|
||||||
"babel-istanbul-loader": "^0.1.0",
|
"babel-istanbul-loader": "^0.1.0",
|
||||||
"babel-loader": "^6.2.4",
|
"babel-loader": "^6.2.10",
|
||||||
"babel-plugin-add-module-exports": "^0.1.2",
|
"babel-plugin-add-module-exports": "^0.2.1",
|
||||||
"babel-plugin-check-es2015-constants": "^6.3.13",
|
"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-arrow-functions": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-block-scoped-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-classes": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-computed-properties": "^6.3.13",
|
"babel-plugin-transform-es2015-computed-properties": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-destructuring": "^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-literals": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-modules-commonjs": "^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-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-shorthand-properties": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-spread": "^6.3.13",
|
"babel-plugin-transform-es2015-spread": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-sticky-regex": "^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-typeof-symbol": "^6.3.13",
|
||||||
"babel-plugin-transform-es2015-unicode-regex": "^6.3.13",
|
"babel-plugin-transform-es2015-unicode-regex": "^6.3.13",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.5.0",
|
"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",
|
"chai": "^3.4.1",
|
||||||
"core-js": "^1.2.1",
|
"core-js": "^2.4.1",
|
||||||
"cross-env": "^1.0.7",
|
"cross-env": "^3.1.4",
|
||||||
"eslint": "^1.10.3",
|
"eslint": "^1.10.3",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-cli": "^0.1.13",
|
"grunt-cli": "^0.1.13",
|
||||||
@@ -59,8 +59,8 @@
|
|||||||
"phantomjs": "^1.9.18",
|
"phantomjs": "^1.9.18",
|
||||||
"sinon": "^1.16.1",
|
"sinon": "^1.16.1",
|
||||||
"sinon-chai": "^2.8.0",
|
"sinon-chai": "^2.8.0",
|
||||||
"webpack": "^2.1.0-beta.4",
|
"webpack": "^2.2.0-rc.3",
|
||||||
"webpack-sources": "^0.1.1"
|
"webpack-sources": "^0.1.3"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "doc"
|
"doc": "doc"
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
"gl-mat2": "^1.0.0",
|
"gl-mat2": "^1.0.0",
|
||||||
"gl-vec2": "^1.0.0",
|
"gl-vec2": "^1.0.0",
|
||||||
"gl-vec3": "^1.0.3",
|
"gl-vec3": "^1.0.3",
|
||||||
"lodash": "^4.6.1",
|
"lodash": "^4.17.4",
|
||||||
"ndarray": "^1.0.18",
|
"ndarray": "^1.0.18",
|
||||||
"ndarray-linear-interpolate": "^1.0.0",
|
"ndarray-linear-interpolate": "^1.0.0",
|
||||||
"webrtc-adapter": "^2.0.2"
|
"webrtc-adapter": "^2.0.2"
|
||||||
|
|||||||
+3
-5
@@ -10,9 +10,9 @@ module.exports = function(grunt) {
|
|||||||
grunt.registerTask('uglyasm', function() {
|
grunt.registerTask('uglyasm', function() {
|
||||||
var code = fs.readFileSync('dist/quagga.js', 'utf-8'),
|
var code = fs.readFileSync('dist/quagga.js', 'utf-8'),
|
||||||
minifiedCode = fs.readFileSync('dist/quagga.min.js', 'utf-8'),
|
minifiedCode = fs.readFileSync('dist/quagga.min.js', 'utf-8'),
|
||||||
commentEnd = '/* @preserve ASM END */',
|
commentEnd = '@preserve ASM END',
|
||||||
moduleFunctionRegex = /function\s*\((\w+,\s*\w+,\s*\w+)\)\s*\{\s*\/\* \@preserve ASM BEGIN \*\//,
|
moduleFunctionRegex = /function\s*\((\w+,\s*\w+,\s*\w+)\)\s*\{(\n?\s*\"use strict\";?)*\n?\/\*\s*\@preserve ASM BEGIN/,
|
||||||
commentStartIdx = code.indexOf("/* @preserve ASM BEGIN */"),
|
commentStartIdx = code.indexOf("@preserve ASM BEGIN"),
|
||||||
asmEndIdxTmp = code.indexOf(commentEnd),
|
asmEndIdxTmp = code.indexOf(commentEnd),
|
||||||
asmEndIdx = code.indexOf("}", asmEndIdxTmp),
|
asmEndIdx = code.indexOf("}", asmEndIdxTmp),
|
||||||
asmCodeTmp = code.substring(commentStartIdx - Math.min(500, commentStartIdx),
|
asmCodeTmp = code.substring(commentStartIdx - Math.min(500, commentStartIdx),
|
||||||
@@ -30,8 +30,6 @@ module.exports = function(grunt) {
|
|||||||
.replace(/ ([+=^|&]|>+|<+) /g, '$1') // remove spaces around operators
|
.replace(/ ([+=^|&]|>+|<+) /g, '$1') // remove spaces around operators
|
||||||
.replace(/[\r\n/]/g, ''); // remove new lines
|
.replace(/[\r\n/]/g, ''); // remove new lines
|
||||||
|
|
||||||
grunt.log.debug(asmCodeMinified);
|
|
||||||
|
|
||||||
asmModule = moduleFunctionRegex.exec(asmCode);
|
asmModule = moduleFunctionRegex.exec(asmCode);
|
||||||
if (!asmModule) {
|
if (!asmModule) {
|
||||||
grunt.log.error("No ASM module found");
|
grunt.log.error("No ASM module found");
|
||||||
|
|||||||
Vendored
+2
-5
@@ -10,14 +10,11 @@ module.exports.plugins = module.exports.plugins.concat([
|
|||||||
compress: {
|
compress: {
|
||||||
warnings: false
|
warnings: false
|
||||||
},
|
},
|
||||||
output: {
|
|
||||||
comments: /@preserve/
|
|
||||||
},
|
|
||||||
sourceMap: false
|
sourceMap: false
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
module.exports.output.filename = 'quagga.min.js';
|
module.exports.output.filename = 'quagga.min.js';
|
||||||
|
|
||||||
module.exports.output.sourceMapFilename = null;
|
module.exports.output.sourceMapFilename = '';
|
||||||
module.exports.devtool = null;
|
module.exports.devtool = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user