Skip to content

Instantly share code, notes, and snippets.

@DveMac
Created March 21, 2014 11:45
Show Gist options
  • Save DveMac/9684459 to your computer and use it in GitHub Desktop.
Save DveMac/9684459 to your computer and use it in GitHub Desktop.
var externals = require('./package.json').dependencies;
gulp.task('modules', function () {
var bs = browserify();
for (var k in externals) {
bs.require(k);
}
bs.transform(debowerify)
.bundle({
debug: !gulp.env.production
})
.pipe(gulp.env.production ? source('modules.min.js') : source('modules.js'))
.pipe(gulp.env.production ? streamify(uglify(uglifyOpts)) : gutil.noop())
.pipe(gulp.dest(assetsRoot))
});
gulp.task('bundle', function () {
var bs = browserify('./src/index.js');
for (var k in externals) {
bs.external(k);
}
bs.transform(reactify)
.bundle({
debug: !gulp.env.production
})
.pipe(gulp.env.production ? source('app.min.js') : source('app.js'))
.pipe(gulp.env.production ? streamify(uglify(uglifyOpts)) : gutil.noop())
.pipe(gulp.dest(assetsRoot))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment