I am trying to slowly introduce Browserify into my site, but I don't want to rewrite all the js and I don't want duplicate instances of jquery and other libraries bundled with my Browserify build.
If I build my module listing jquery as an external dependency, how do I then point it at my global jquery instance? Also the goal is to eliminate the mylibs global (example below), so I don't want to use it in my module.
This is what I'm trying to do (psudo-code). This would be in my site's repo - not the module's. The module would be installed with Bower:
var mylibs.jQuery = $.noConflict(); // global used by lots of existing code
module.exports = {
jquery: mylibs.jQuery // can be imported by my module as require('jquery')
};
Something like that is what I'm trying to achieve. Is this possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…