Created
July 28, 2015 13:12
-
-
Save iovar/3ed17b66e68083977f4c 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'); | |
var babel = require('gulp-babel'); | |
var babelify = require('babelify'); | |
var uglify = require('gulp-uglify'); | |
var streamify = require('gulp-streamify'); | |
var browserify = require('browserify'); | |
var source = require('vinyl-source-stream'); | |
var del = require('del'); | |
var vinylPaths = require('vinyl-paths'); | |
gulp.task('default', ['build', 'modules']); | |
gulp.task('watch', function(){ | |
gulp.watch(['src/*.js', 'src/**/*.js'], ['default']); | |
}); | |
gulp.task('build', function () { | |
return gulp.src(['src/*.js', 'src/**/*.js']) | |
.pipe(babel()) | |
.pipe(gulp.dest('tmp')); | |
}); | |
gulp.task('modules',['build'], function() { | |
browserify({ | |
entries: './tmp/app.js', | |
debug: true | |
}) | |
.transform(babelify) | |
.bundle() | |
.pipe(source('bundle.js')) | |
//.pipe(streamify(uglify())) | |
.pipe(gulp.dest('./dist')); | |
}); | |
gulp.task('clean', function() { | |
del(['tmp/']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment