Skip to content

Instantly share code, notes, and snippets.

@spacepluk
Created April 29, 2014 10:47
Show Gist options
  • Save spacepluk/11396649 to your computer and use it in GitHub Desktop.
Save spacepluk/11396649 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var browserify = require('browserify');
var handleErrors = require('../util/handleErrors');
var source = require('vinyl-source-stream');
var packageJson = require('../../package.json');
var dependencies = Object.keys(packageJson && packageJson.dependencies || {});
gulp.task('libs', function () {
return browserify()
.require(dependencies)
.bundle()
.on('error', handleErrors)
.pipe(source('libs.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('scripts', function () {
return browserify('./src/main.js')
.external(dependencies)
.bundle()
.on('error', handleErrors)
.pipe(source('main.js'))
.pipe(gulp.dest('./build/'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment