Created
March 21, 2014 11:45
-
-
Save dmaevac/9684459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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