Skip to content

Instantly share code, notes, and snippets.

@andrewmartin
Created April 9, 2014 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewmartin/10232136 to your computer and use it in GitHub Desktop.
Save andrewmartin/10232136 to your computer and use it in GitHub Desktop.
gulpfile-viget-pattern-test.js
var watch = require('gulp-watch'),
livereload = require('gulp-livereload');
gulp = require("./gulp")([
"nodemon",
"coffee",
"stylus",
"concat_app",
"concat_vendor",
"uglify_app",
"uglify_vendor",
// "jst-concat",
"cssmin"
]);
gulp.task("watch", function() {
gulp.watch([
'public/stylesheets/**/*.styl'
], ['stylus']);
gulp.watch([
// our watched files
'**/*.coffee'
], [
// our tasks to run
'coffee'
]);
gulp.watch([
'public/javascripts/*.js'
], [
'concat_app',
'concat_vendor'
]);
var server = livereload();
gulp.watch([
'public/stylesheets/application.css',
'public/javascripts/*.js'
])
.on('change', function(file) {
server.changed(file.path);
});
});
// dev server
gulp.task("server", ["nodemon"]);
// compile stuff
gulp.task("compile", [
"coffee",
"stylus"
]);
// minify/compress.
// i'd think we could actually build these all out using pipe
gulp.task("compress", [
"concat_app",
"concat_vendor",
"uglify_app",
"uglify_vendor",
"cssmin"
]);
// DEVELOP: basic watch task.
gulp.task("default", [
"compile",
"compress",
"watch"
]);
// PRODUCTION: basic compilation step.
gulp.task("build", [
"compile",
"compress"
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment