Skip to content

Instantly share code, notes, and snippets.

@vitqst
Forked from iovar/react-es6-gulpfile.js
Created June 20, 2018 08:04
Show Gist options
  • Save vitqst/06787d67968c5d446746a8be9e033065 to your computer and use it in GitHub Desktop.
Save vitqst/06787d67968c5d446746a8be9e033065 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