Updating gulpfile.
authorSteve Sutton <ssutton@gmail.com>
Sun, 27 Aug 2017 17:09:09 +0000 (13:09 -0400)
committerSteve Sutton <ssutton@gmail.com>
Sun, 27 Aug 2017 17:09:09 +0000 (13:09 -0400)
Adding jshint and plumber to have a lint checker for the js files and
plumber is to keep the gulp task running even if the jshint runs into an
error.

gulpfile.js
package.json

index 8009dc1..863192a 100644 (file)
@@ -1,12 +1,15 @@
-var gulp = require('gulp'),
-    watch = require('gulp-watch'),
-    concat = require('gulp-concat'),
-    uglify = require('gulp-uglify');
+var gulp    = require('gulp'),
+    concat  = require('gulp-concat'),
+    uglify  = require('gulp-uglify'),
+    jshint  = require('gulp-jshint'),
+    plumber = require('gulp-plumber');
 
 gulp.task('scripts', function(){
-    gulp.src(['./js/models/*.js', './js/collections/*.js', './js/views/*.js'])
+    gulp.src(['js/models/*.js', './js/collections/*.js', './js/views/*.js'])
         .pipe(concat('glmApp.js'))
+        .pipe(plumber())
         .pipe(uglify())
+        .pipe(jshint())
         .pipe(gulp.dest('./js/'));
 });
 
index cb0c0e5..035daec 100644 (file)
@@ -15,7 +15,9 @@
   "devDependencies": {
     "gulp": "^3.9.1",
     "gulp-concat": "^2.6.1",
+    "gulp-jshint": "^2.0.4",
+    "gulp-plumber": "^1.1.0",
     "gulp-uglify": "^3.0.0",
-    "gulp-watch": "^4.3.11"
+    "jshint": "^2.9.5"
   }
 }