Closed actionshrimp closed 11 years ago
Ah this must actually be a bug with the older (2.10.0) version of browserify rather than proxyquireify. If i just use browserify directly (not via proxyquireify) on that version I get the same problem. Should probably have tried that first.
Sorry for spamming you all morning!
Browserify supports a "browser" setting in the package.json, so you can add for example:
into the package.json, and browserify will replace modules loaded with require('jquery') in your code with the mapped module (in the example it would be 'jquery-browserify').
It looks like some of proxyquireify's magic is breaking this, as I get an error during bundling saying that browserify can't open
/full/path/to/project/jquery-browserify, when it should be looking in /full/path/to/project/node_modules/jquery-browserify.
I can change the package.json to "./node_modules/jquery-browserify/lib/jquery.js" for the time being and it works.