Skip to content

Instantly share code, notes, and snippets.

@elrrrrrrr
Created September 18, 2014 14:20
Show Gist options
  • Save elrrrrrrr/91a884de37250270e1ef to your computer and use it in GitHub Desktop.
Save elrrrrrrr/91a884de37250270e1ef to your computer and use it in GitHub Desktop.
common gulpfile.js
var gulp = require('gulp'),
stylus = require('gulp-stylus'),
jade = require('gulp-jade');
jademod = require('jade2mod');
var paths = {
stylus: ['stylus/*.styl'],
html: ['html/*.html'],
jade: ['jade/*.jade'],
engine: ['jade/engine/*.jade']
};
gulp.task('stylus', function() {
return gulp.src(paths.stylus)
.pipe(stylus())
.pipe(gulp.dest('css'));
});
gulp.task('jade', function() {
return gulp.src(paths.jade)
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('html'));
});
gulp.task('engine', function() {
return gulp.src(paths.engine)
.pipe(jademod({suffix: '\nexports.render = template'}))
.pipe(gulp.dest('js/engine'));
})
gulp.task('watch', function() {
gulp.watch(paths.stylus, ['stylus']);
gulp.watch(paths.jade, ['jade']);
gulp.watch(paths.engine, ['engine']);
});
gulp.task('default', ['stylus', 'jade']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment