Skip to content

Instantly share code, notes, and snippets.

@allanfreitas
Forked from revolunet/browserify.js
Created July 8, 2016 10:48
Show Gist options
  • Select an option

  • Save allanfreitas/23dacce1d9fbbec032f51cbb6d845aa1 to your computer and use it in GitHub Desktop.

Select an option

Save allanfreitas/23dacce1d9fbbec032f51cbb6d845aa1 to your computer and use it in GitHub Desktop.
Sample split grunt-browserify config for vendors + applications files with react
var externalModules = [
'fs',
'events',
'react',
'react-addons',
'lodash'
];
module.exports = {
vendors: {
src: ['.'],
dest: 'js/vendors.js',
options: {
debug: true,
alias: externalModules.map(function(module) {
return module + ':';
}),
external: null
}
},
dev: {
options: {
transform: ['reactify', 'brfs'],
debug: true,
external: externalModules
},
files: {
'js/bundle.js': ['src/app.jsx'],
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment