From bed04e1c1c638b3f69efc8e13de8260b4438544b Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 23 Dec 2014 15:45:28 -0500 Subject: [PATCH] Added uglify-js to minify the browserified bitcore --- gulpfile.js | 16 +++------------- package.json | 4 ++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index eb9519b002d..d4a97b47bfb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,6 @@ 'use strict'; var gulp = require('gulp'); -var closureCompiler = require('gulp-closure-compiler'); var coveralls = require('gulp-coveralls'); var jshint = require('gulp-jshint'); var mocha = require('gulp-mocha'); @@ -91,18 +90,9 @@ gulp.task('browser:uncompressed', ['browser:makefolder', 'errors'], shell.task([ './node_modules/.bin/browserify index.js --insert-global-vars=true --standalone=bitcore -o browser/bitcore.js' ])); -gulp.task('browser:compressed', ['browser:makefolder', 'errors'], function() { - return gulp.src('dist/bitcore.js') - .pipe(closureCompiler({ - fileName: 'bitcore.min.js', - compilerPath: 'node_modules/closure-compiler-jar/compiler.jar', - compilerFlags: { - language_in: 'ECMASCRIPT5', - jscomp_off: 'suspiciousCode' - } - })) - .pipe(gulp.dest('dist')); -}); +gulp.task('browser:compressed', ['browser:uncompressed'], shell.task([ + './node_modules/.bin/uglifyjs dist/bitcore.js --compress --mangle -o dist/bitcore.min.js' +])); gulp.task('browser:maketests', ['browser:makefolder'], shell.task([ 'find test/ -type f -name "*.js" | xargs ./node_modules/.bin/browserify -t brfs -o browser/tests.js' diff --git a/package.json b/package.json index d33fa74982c..1ce7b3754bf 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,6 @@ "brfs": "1.2.0", "browserify": "~6.3.3", "chai": "~1.10.0", - "closure-compiler-jar": "git://github.com/eordano/closure-compiler-jar.git", "gulp": "^3.8.10", "gulp-closure-compiler": "^0.2.9", "gulp-coveralls": "^0.1.3", @@ -107,7 +106,8 @@ "plato": "^1.3.0", "run-sequence": "^1.0.2", "sinon": "^1.12.2", - "through2": "=0.6.3" + "through2": "=0.6.3", + "uglify-js": "=2.4.16" }, "license": "MIT" }