Closed sikoried closed 10 years ago
It's actually something I always want to refactor. Features creep, and some code paths got forgotten. I'll try to get that code path to respect some options added lately.
For the list of files, you may want to check tasks/lib/helpers.js:40.
Well, it seems eliminating the if
block is the way to go, tests are good.
I'm using bower to install jquery (2.1.0) and (e.g.) bootstrap, and then
grunt bower
withto install those components in
build/bower_components
. It works as expected for bootstrap, copyingbower_components/bootstrap/{less,dist/css,dist/js}/*
tobuild/bower_components/bootstrap/{less,dist/css,dist/js}/*
, but it fails for jquery, copyingbower_components/jquery/dist/jquery.js
tobuild/bower_components/jquery/jquery.js
, which in turn leads to problems when usinggrunt-wiredep
(which expects jquery.js in dist/).I tracked down the issue to tasks/bower.json:126, where there is an if-statement that treats those libs special, that only have one entry in src_path. For this (rare?) case, the subdirectory structure is (accidentally?) dropped. I managed to fix it by eliminating the
if
block and defaulting theelse
block (i.e. every lib is handled the same way, regardless of 1 or more src_path entries). As a result, subdirectory structure is preserved also for src_path.length===1.Sorry, no pull-request, as I didn't run any tests on this, nor know if this would be the intended behavior. But it would be great if you could verify and patch this issue.
Thanks!
PS: I couldn't track down where the task gets it's list of files, and changes in the jquery's bower.json:main variable didn't affect the behavior. Would you mind pointing that out?