Skip to content

Instantly share code, notes, and snippets.

@RichardLitt
Created March 9, 2015 18:59
Show Gist options
  • Select an option

  • Save RichardLitt/48de711c8de2b02d1319 to your computer and use it in GitHub Desktop.

Select an option

Save RichardLitt/48de711c8de2b02d1319 to your computer and use it in GitHub Desktop.
// Initiation of browserify object
var b = browserify({
// Required watchify args
'cache': {},
'packageCache': {},
'fullPaths': true,
// Browserify options
'entries': [paths.jsPath + 'main.js'],
'noParse': ['react.js', 'jquery.js', 'pdf.combined.js'],
'transform': [reactify]
})
.transform('brfs', { global: true })
// For one-off bundling. browserify bundle - brundle is a joke.
gulp.task('brundle', function() {
return b.bundle()
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(source('main.min.js'))
// If you want your source maps up in your console
// .pipe(buffer())
// .pipe(sourcemaps.init({loadMaps: true}))
// .pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./build'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment