Skip to content

Instantly share code, notes, and snippets.

@chandu
Last active August 29, 2015 13:58
Show Gist options
  • Select an option

  • Save chandu/10430351 to your computer and use it in GitHub Desktop.

Select an option

Save chandu/10430351 to your computer and use it in GitHub Desktop.
var $ = require('jquery');
var browserify = require('browserify');
var shim = require('browserify-shim');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var createCommonBundle = function() {
var inst = browserify();
inst .add(require.resolve('./js/common.js'))
.bundle()
.pipe(source('common.js'))
.pipe(gulp.dest('../public/js/'));
};
gulp.task('default', function() {
gulp.src('./components/modernizr/modernizr.js')
.pipe(gulp.dest('../public/js/'));
createCommonBundle();
});
"browserify": {
"transform": [ "browserify-shim" ]
},
"browser": {
"jquery" : "./components/jquery/jquery.js",
"bootstrap" : "./components/bootstrap/dist/js/bootstrap.js"
},
"browserify-shim": {
"jquery" : {
"exports" : "$"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment