Skip to content

Instantly share code, notes, and snippets.

@Pranz
Created November 25, 2015 15:08
Show Gist options
  • Save Pranz/ae895be8bdb13ad8cd8b to your computer and use it in GitHub Desktop.
Save Pranz/ae895be8bdb13ad8cd8b to your computer and use it in GitHub Desktop.
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