cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhi...@apache.org
Subject [1/2] cordova-registry-web git commit: Add support for uglify
Date Sat, 27 Jun 2015 00:18:47 GMT
Repository: cordova-registry-web
Updated Branches:
  refs/heads/master b95626a89 -> 63c85a103


Add support for uglify


Project: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/commit/bf6e0597
Tree: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/tree/bf6e0597
Diff: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/diff/bf6e0597

Branch: refs/heads/master
Commit: bf6e0597e0b89523a9a5d8c1b368dd9a0eede996
Parents: b95626a
Author: Nikhil Khandelwal <nikhilkh@microsoft.com>
Authored: Thu Jun 25 14:28:53 2015 -0700
Committer: Nikhil Khandelwal <nikhilkh@microsoft.com>
Committed: Thu Jun 25 14:28:53 2015 -0700

----------------------------------------------------------------------
 npm-search/Gulpfile.js  | 8 ++++++--
 npm-search/package.json | 5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-registry-web/blob/bf6e0597/npm-search/Gulpfile.js
----------------------------------------------------------------------
diff --git a/npm-search/Gulpfile.js b/npm-search/Gulpfile.js
index 33c7888..5408b1a 100644
--- a/npm-search/Gulpfile.js
+++ b/npm-search/Gulpfile.js
@@ -6,7 +6,9 @@ var gulp       = require('gulp'),
     source     = require('vinyl-source-stream'),
     browserify = require('browserify'),
     argv       = require('yargs').argv,
-    reactify   = require('reactify');
+    reactify   = require('reactify'),
+    uglify     = require('gulp-uglify'),
+    gulpif     = require('gulp-if');
 
 gulp.task('styles', function () {
     gulp.src(['assets/css/base.css', 'assets/css/flexboxgrid.css'])
@@ -22,6 +24,8 @@ gulp.task('scripts', function () {
         .on('error', gutil.log)
         .pipe(source('app.js'))
         .pipe(buffer())
+        .pipe(gulpif(!argv.debug, uglify())) // minify only if not debug build.
+        .on('error', gutil.log)
         .pipe(gulp.dest('./build/'));
 });
 
@@ -36,7 +40,7 @@ gulp.task('images', function () {
 gulp.task('dev', function () {
     gulp.run('build');
 
-    gulp.watch(['assets/js/**/*.js', 'assets/js/official-plugins.json'], [ 'scripts' ]);
+    gulp.watch(['assets/js/**/*.js', 'assets/js/*.json'], [ 'scripts' ]);
     gulp.watch('assets/css/**/*.css', [ 'styles' ]);
     gulp.watch('assets/img/**/*', [ 'images' ]);
 

http://git-wip-us.apache.org/repos/asf/cordova-registry-web/blob/bf6e0597/npm-search/package.json
----------------------------------------------------------------------
diff --git a/npm-search/package.json b/npm-search/package.json
index 1ca65a5..7cf0e28 100644
--- a/npm-search/package.json
+++ b/npm-search/package.json
@@ -22,12 +22,15 @@
     "gulp-concat": "^2.5.2",
     "gulp-imagemin": "^2.2.1",
     "gulp-util": "^3.0.5",
+    "gulp-if": "^1.2.5",
+    "gulp-uglify": "^1.2.0",
     "react": "^0.13.3",
     "react-tools": "^0.13.3",
     "reactify": "^1.1.1",
     "classnames": "^2.1.2",
     "vinyl-buffer": "^1.0.0",
-    "vinyl-source-stream": "^1.1.0"
+    "vinyl-source-stream": "^1.1.0",
+    "yargs": "^3.12.0"
   },
   "maintainers": [
     {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message