So I know how to manually fix this but it's annoying!
I included bootstrap dropdown.js and at the end of the function is
}(jQuery);
Inside my shim I set jquery as a dependency
'bootstrap': {
"exports": 'bootstrap',
"depends": {
"jquery": '$'
}
},
It seems like this is the only way to use $, but since the dropdown has jQuery at the end the console shows
ReferenceError: jQuery is not defined
}(jQuery);
Changing it to }($); works.
So my question is does anyone have any idea to better do this without manually doing it, or is manually editing the script the best?
(function($){ $.fn.function_name = function(x){}; })(jQuery);That code allows the jQuery keyword to be used with$, but for some reason I have to manually change(jQuery)to($). I didn't give it much thought after it worked, but perhaps I should re think this.window.jQuery = require('jquery.js');