Created
August 15, 2016 19:07
-
-
Save jeremy-brenner/bcb33e2348576fb01e3a7a1328ec8892 to your computer and use it in GitHub Desktop.
gulpfile
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
var gulp = require('gulp'); | |
var pug = require('gulp-pug'); | |
var stylus = require('gulp-stylus'); | |
var babel = require('gulp-babel'); | |
var concat = require('gulp-concat'); | |
var copy = require('gulp-copy'); | |
gulp.task('default', ['compile']); | |
gulp.task('compile', ['pug','styl','babel','img'] ); | |
gulp.task('watch', ['compile','watchers'] ); | |
gulp.task('watchers', function() { | |
gulp.watch('src/*.pug', ['pug'] ); | |
gulp.watch('src/styl/*.styl', ['styl'] ); | |
gulp.watch('src/js/**/*.js', ['babel'] ); | |
gulp.watch('src/img/**/*', ['img'] ); | |
}); | |
gulp.task('pug', function(){ | |
gulp.src('src/*.pug') | |
.pipe(pug()) | |
.pipe(gulp.dest('www/')); | |
}); | |
gulp.task('styl', function(){ | |
gulp.src('src/styl/*.styl') | |
.pipe(stylus()) | |
.pipe(gulp.dest('www/css/')); | |
}); | |
gulp.task('babel',function(){ | |
gulp.src('src/js/**/*.js') | |
.pipe(babel({ | |
presets: ['es2015'] | |
})) | |
.pipe(concat('index.js')) | |
.pipe(gulp.dest('www/js/')); | |
}); | |
gulp.task('img',function(){ | |
gulp.src('src/img/**/*') | |
.pipe(copy('www/img/',{prefix:2})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment