Created
September 18, 2014 14:20
-
-
Save elrrrrrrr/91a884de37250270e1ef to your computer and use it in GitHub Desktop.
common gulpfile.js
This file contains hidden or 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
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