Skip to content

Instantly share code, notes, and snippets.

@iovar
Created July 28, 2015 13:12
Show Gist options
  • Save iovar/3ed17b66e68083977f4c to your computer and use it in GitHub Desktop.
Save iovar/3ed17b66e68083977f4c to your computer and use it in GitHub Desktop.
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