Skip to content

Instantly share code, notes, and snippets.

@gon250
Created April 13, 2015 08:22
Show Gist options
  • Save gon250/477d8ab78d2280b6ea4d to your computer and use it in GitHub Desktop.
Save gon250/477d8ab78d2280b6ea4d to your computer and use it in GitHub Desktop.
Quick example - gulp
"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);
});
{
"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