Open seanhess opened 10 years ago
@seanhess what version of the task do you use? Version 0.3.3 introduced this issue, but it was fixed quickly in 0.3.4.
I installed it via NPM yesterday. I'll check soon and let you know.
On Sunday, November 24, 2013, Ivan Yatskevich wrote:
@seanhess https://github.com/seanhess what version of the task do you use? Version 0.3.3 introduced this issue, but it was fixed quickly in 0.3.4.
— Reply to this email directly or view it on GitHubhttps://github.com/yatskevich/grunt-bower-task/issues/90#issuecomment-29152800 .
I am using 0.3.4 and still have the issue. Am I configuring it wrong? Does it check for bower.json
automatically or am I supposed to tell the config about the file or something?
Any word on a fix for this?
This bug is because I have a .bowerrc
file that tells bower to install to a different directory. It must override whatever settings you are sending it. So, it was installing the dependencies to my public/bower/
directory the whole time, but it printed that it installed to a different folder in the terminal so I thought it wasn't working.
So all this does is run bower install
for you? Does it have any facility for reading bower.json
to look for the assets and scripts and move them around or concatenate them?
Ok, I think this is maybe just a documentation problem. I was originally ONLY looking for a tool to grab the main files from each bower dependencies and put them somewhere. This tool can do that, but it is hidden way down the page, and the workflow is confusing (I originally had bower and this tool targeting the same folder, which didn't work).
So this doesn't really do anything for me either....
I switched to using https://github.com/sapegin/grunt-bower-concat - It doesn't do the same thing, but is more what I wanted. The maintainer is active.
On Tue, Dec 10, 2013 at 3:01 PM, drozzy notifications@github.com wrote:
So this doesn't really do anything for me either....
— Reply to this email directly or view it on GitHubhttps://github.com/yatskevich/grunt-bower-task/issues/90#issuecomment-30272641 .
@seanhess Wow, looks great. Thanks. EDIT: Yeah... that doesn't work flawlessly either. And it doesn't work for non-js files (css/fonts etc.)
@seanhess Could you please point to a docs section which is not clear or misleading? I'd be happy to improve the docs :smile:
@drozzy What do you expect from grunt-bower-task
?
I think it wasn't clear that the files are installed to a folder different from your bower folder. See my comment above.
I needed a tool that made bower "just work", and copying main files into a folder isn't as important as combining the JS in dependency order. That's why I'm using grunt-bower-concat. I'm not sure what problem this solves. I just checked the docs, and it jumps right in to usage. I think a section on the problem you're solving would be good.
I think you should clear up what all the folders mean in the docs.
Thanks for the clarification! We're going to simplify workflow in the next version (see #93).
@seanhess Do you think we can close this issue for now?
Yes, go ahead
On Wed, Dec 11, 2013 at 8:49 AM, Ivan Yatskevich notifications@github.comwrote:
Do you think we can close this issue for now?
— Reply to this email directly or view it on GitHubhttps://github.com/yatskevich/grunt-bower-task/issues/90#issuecomment-30331529 .
No, I think copying the files is pretty important too. For example consider a workflow with coffee/script or live script which need to be compiled prior to distribution.
The problem with this plugin was that it didn't do anything when I ran the grunt bower:install
command (no folder was created under my lib or anything).
@drozzy If you create a gist (like this one) which reproduces your problem, then I'll be able to check things out on my machine.
I encountered the same issue while coping files to another folder (i.e. from bower_components/*.*
to web/bower_components/*.*
) with version 0.3.x, but everything is fine after I rollback to 0.2.x.
{
"directory": "bower_components",
"json": "bower.json"
}
bower: {
copy: {
options: {
targetDir: 'web/bower_components', // A directory where you want to keep your Bower packages.
install: false, // Whether you want to run bower install task itself (e.g. you might not want to do this each time on CI server).
cleanTargetDir: true, // Will clean target dir before running install.
cleanBowerDir: false, // Will remove bower's dir after copying all needed files into target dir.
copy: true, // Copy Bower packages to target directory.
//cleanup: false, // If set to true or false then both cleanBowerDir & cleanTargetDir are set to the value of cleanup.
layout: function(type, component) { // There are two built-in named layouts: byType and byComponent.
return path.join(type, component);
},
verbose: true // The task will provide more (debug) output when this option is set to true.
}
}
}
I'm having the same issue mentioned above ^
I was having the same problems and tracked it down the bower.commands.list call. This little patch fixed the problems for me.
--- a/tasks/lib/bower_assets.js
+++ b/tasks/lib/bower_assets.js
@@ -57,7 +57,7 @@ BowerAssets.prototype.get = function() {
var bowerConfig = grunt.file.readJSON(path.join(this.cwd, this.config));
var exportsOverride = bowerConfig.exportsOverride;
- var paths = bower.commands.list({paths: true});
+ var paths = bower.commands.list({paths: true, relative: false});
paths.on('end', function(data) {
this.emit('end', this.mergePaths(data, exportsOverride ? exportsOverride :
}.bind(this));
I also had this issue, I can confirm that removing my .bowerrc made the task work as expected. With it present nothing seems to happen (although it reports success).
+1 for the .bowerrc issue persisting in 0.3.4
Why doesn't it respect the directory setting in .bowerrc? This requires me having to specify it in 2 locations, making it brittle.
+1 for the .bowerrc issue persisting in 0.3.4
+1 I'm getting this as well.
I have a bower.json in the root of my repository. I followed the setup instructions carefully. I am an experienced grunt and bower user.
When I run it, it says the following
There are no files in the lib directory. It exits successfully, but doesn't seem to do anything.
Here is my bower file: (saved in
bower.json
in the root of the repository)