-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jQuery dependency problematic with Webpack #578
Comments
@TomiS thank you for filing a bug report! I am aware of this and i am hoping to get a fix out sometime soon |
@TomiS were you able to get it to work when you replaced the From from basic Google searching/Github issue searching/playing around with it in an app using a webpack setup, the best option I can think of for the time being would be to wrap the Go into the if (typeof define === "function" && define.amd) {
var jQuery;
try {
define(["jquery"], factory);
} catch (err) {
define([""], factory);
}
...
} |
I tried and it doesn't work with an empty string but works with a totally empty array. Also I think |
Agreed. If you end up finding a more elegant solution to this, please let us know! I tried to fruitlessly Google variations of "UMD modules webpack build error" and could not find anything better :( Thanks for making the PR! I will merge/version bump |
Thanks for merging and tagging. I'll keep my eyes open for improvements. |
Hi. I'm trying to wrap a slider inside a React component using Webpack as a module bundler. I don't have jQuery installed at all. Everything works mostly great but there might be a problem with how this library is related to jQuery. Docs say there is no requirement for jQuery but Webpack tries to look for jQuery when bundling the source code and produces this error:
As the error states, Webpack ends up here:
https://github.com/seiyria/bootstrap-slider/blob/v7.0.2/dist/bootstrap-slider.js#L42
If I remove the quoted "jquery" dependency like this:
define([], factory);
the error disappears. I have very little experience with amd wrappers so I'm not sure how this should be solved but I kind of want to question if jQuery really should be a hard dependency on that line of code when it's not a dependency even inpackage.json
ps. Thanks for the otherwise very nice library.
The text was updated successfully, but these errors were encountered: