Skip to content

Instantly share code, notes, and snippets.

@gcpantazis
Created September 8, 2014 23:32
Show Gist options
  • Save gcpantazis/209c6e7767f47ba37575 to your computer and use it in GitHub Desktop.
Save gcpantazis/209c6e7767f47ba37575 to your computer and use it in GitHub Desktop.
Gulp setup for browserify with transforms, plugins, minification, and sourcemaps.
var browserify = require('browserify');
var source = require('vinyl-source-stream');
gulp.task('scripts', function() {
var bundler = browserify({
entries: ['./app/scripts/app.js'],
debug: true,
transform: ['reactify', 'debowerify']
});
return bundler
.plugin('minifyify', {
map: 'bundle.map.json',
output: 'dist/scripts/bundle.map.json'
})
.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest('dist/scripts'))
.pipe($.connect.reload());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment