Created
November 25, 2015 15:08
-
-
Save Pranz/ae895be8bdb13ad8cd8b to your computer and use it in GitHub Desktop.
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') | |
jade = require('gulp-jade') | |
babel = require('gulp-babel') | |
sass = require('gulp-sass') | |
concat = require('gulp-concat') | |
path = require('path'); | |
paths = { | |
jade: './src/jade/**/*.jade', | |
sass: './src/sass/**/*.scss', | |
js: './src/js/**/*.{js, jsx}', | |
out: './public' | |
} | |
gulp.task('jade', () => { | |
gulp.src(paths.jade) | |
.pipe(jade({ | |
pretty: true | |
}).on('error', console.log)) | |
.pipe(gulp.dest(paths.out)); | |
}); | |
gulp.task('sass', () => { | |
gulp.src(paths.sass) | |
.pipe(sass().on('error', console.log)) | |
.pipe(concat('style.css')) | |
.pipe(gulp.dest(path.join(paths.out, 'css'))); | |
}); | |
gulp.task('js', () => { | |
gulp.src(paths.js) | |
.pipe(babel({ | |
presets: ['react'] | |
})) | |
.pipe(concat('main.js')) | |
.pipe(gulp.dest(path.join(paths.out, 'js'))); | |
}); | |
gulp.task('default', ['js', 'sass', 'jade']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment