I’m working with a couple of node.js modules that I require on the client:
index.js:
var sync = require('../lib/sync');
So I figured browserify might be the best choice. Bundling the files works great, however, browserify wraps everything in a (function(){my code here})(); which cause the Can't find variable: require error. How can I prevent that behaviour?
When I remove the wrap, everything works as expected without errors.
I run browserify with “–exports require”, would this be what you need?