Closed Neppord closed 9 years ago
There is a workaround for those interested.
By adding 2 aliases:
{
"browser": {
"$": "path/to/jquery",
"jquery": "path/to/jquery"
},
"browserify-shim": {
"bootstrap": {"depends": ["jquery:jQuery", "$:$"]}
}
}
Why would you need to do that?
Hi @bendrucker!
If you one of your libraries, bootstrap in this example, checks for one and uses the other.
So it checks for the jQuery
var to see if it exists but then uses $
for all its manipulations.
check: https://github.com/twbs/bootstrap/blob/master/dist/js/bootstrap.js#L7
usage: https://github.com/twbs/bootstrap/blob/master/dist/js/bootstrap.js#L13
i see here that bootstrap is a better citizen and actual only uses jQuery
, the $
is from the function scope assigned to the argument.
but there are definitely others that is less well behaved.
The syntax on this would be very tricky. Doesn't seem like an especially prominent issue, especially since it's really only going to affect jQuery plugins. If you're up for it, adding the workaround to the wiki seems like the best bet here.
Seams to break.