Created
April 13, 2015 08:22
-
-
Save gon250/477d8ab78d2280b6ea4d to your computer and use it in GitHub Desktop.
Quick example - gulp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var gulp = require('gulp'), | |
jshint = require('gulp-jshint'), | |
browserSync = require('browser-sync'), | |
runSequence = require('run-sequence'), | |
reload = browserSync.reload; | |
gulp.task('lint', function() { | |
return gulp.src('./app/**/*.js') | |
.pipe(jshint()) | |
.pipe(jshint.reporter('default')); | |
}); | |
gulp.task('serve', function(cb) { | |
browserSync({ | |
port: 8080, | |
server: { | |
baseDir: "./" | |
} | |
}); | |
gulp.watch([ | |
"./app/**/*.js", | |
"./app/**/*.html", | |
"./assets/css/**/*.css", | |
"./assets/img/**/*.*", | |
"./index.html" | |
], browserSync.reload, cb); | |
}); | |
gulp.task('default', function (cb) { | |
runSequence('lint', 'test', cb); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "public", | |
"version": "1.0.0", | |
"description": "Demo", | |
"main": " ", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Gonzalo Barba", | |
"license": "ISC", | |
"devDependencies": { | |
"browser-sync": "^2.2.2", | |
"gulp": "^3.8.11", | |
"gulp-jshint": "^1.9.4", | |
"run-sequence": "^1.0.2" | |
}, | |
"peerDependencies": { | |
"gulp": "^3.8.11", | |
"browser-sync": "^2.2.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment