-
Notifications
You must be signed in to change notification settings - Fork 63
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
Wiredep bug - item.js missing in bower.json main #33
Comments
Actually this already happened in v1.3.0 Looks like @dimerman had a similar issue back in 2013 : a0d5481 Seems like I "need to have item.js before outlayer.js". But |
bower's Unfortunately, this may break build tools. Thanks for reporting this issue. |
I was affected by this as I use wiredep for loading the bower dependencies into my web projects. I can understand the single file entry point philosophy in bower only if the file actually serves as a single entry point. Either a single concatenated distribution file or a single file which requires all others in some way. Until this is resolved I have added the below override to my growing list of overrides to patch scenarios like this one. Hopefully this helps others. "overrides": {
"outlayer": {
"main": [
"item.js",
"outlayer.js"
]
}
} |
Thanks @EHLOVader ! That did the trick for me |
Sorry to bother @EHLOVader but i'm a noob. Does the override snipet you showed goes on the bower.json after the dependencies or somewhere different? |
@jesusjackson you've got it! You just add an overrides property to your bower.json object. It can go anywhere afaik. I think the property is "unofficial" but I can't see it going anywhere any time soon. So many people depend on it for things like this. Here are details from Roots.io, was the best doc I found on the topic. https://roots.io/using-bootstrap-with-bower-how-to-override-bower-packages/ |
Thanks for the quick answer @EHLOVader, but apparently grunt is ignoring the overrides
Is generating these two lines instead of the ones i specified on the override:
|
@jesusjackson That is certainly odd. Perhaps not using a This override that I have here is only a fraction of the full override I have started using myself. Since the definition of the I think a pretty complete override that worked for me is here metafizzy/isotope#879 (comment) I had to include the dependencies on that one for If that doesn't work what are you using for grunt to handle the dependencies? I use gulp myself, but I see Good luck. |
No use @EHLOVader, apparently bower hates me. I use
|
Thanks @jesusjackson this helped me out. |
For anyone using
|
@OmgImAlexis You shouldn't do it this way, you will end up including Outlayer twice in your generated file, because isotope.pkgd.min.js already includes it. Here's my version: module.exports = function(grunt) {
grunt.initConfig({
bower_concat: {
yourBuildTarget: {
mainFiles: {
// outlayer (and isotope) have a main-definition that conflicts with non-module loader setups.
// See https://github.com/metafizzy/outlayer/issues/33
'outlayer': ['item.js', 'outlayer.js'],
'isotope': [
'js/item.js',
'js/layout-mode.js',
'js/layout-modes/fit-rows.js', 'js/layout-modes/masonry.js', 'js/layout-modes/vertical.js',
'js/isotope.js',
],
}
}
}
});
// …
} |
Isn't there an official resolution for this yet? |
It basically is resolved. From the comment above:
There is still some discussion over here bower/spec#47 on ways to improve this beyond just using overrides, but overrides or using the pkgd dist file is the official solution afaik. |
Thanks @EHLOVader! For anyone using Grunt, here's my version on fixing Masonry dependencies:
|
Thanks @EHLOVader it worked for me. |
Hello,
It appears that commit 914f1f2 introduced a bug:
914f1f2#diff-a63318b17de3bf77b5cd6eb71e7aae44R46
How can
window.Outlayer.Item
be defined before assigning the result of thefactory
call towindow.Outlayer
?My Karma tests fail on this when launching PhantomJS, with the following error:
Or did I got the root cause wrong ?
The text was updated successfully, but these errors were encountered: