Closed rbudiharso closed 9 years ago
Why did you add the src/
folder as a localFolder, and added the CSS files to filesNeeded.css
? You don't need to do this, your index.html will automatically include any CSS files you have in your style/
or core/
folders.
I also don't fully understand your problem. It is true that it only symlinks the innermost directory, what do you suggest instead? The symlinked folder also links to any subfolders in your link source. So, if you have files that are further down, you can just add those to the path:
bower: {
packages: [
'http://code.jquery.com/jquery-2.1.0.min.js',
'bootswatch-dist#3.2.0-lumen'
],
localFolders: ['src/style'],
filesNeeded: {
js: [
'jquery-2.1.0.min/index.js',
'bootswatch-dist/js/bootstrap.min.js'
],
css: [
'bootswatch-dist/css/bootstrap.min.css',
'style/main.css',
'style/somefolder/test.css',
'style/somefolder/subfolder/test.css',
]
}
},
Does that make sense to you?
The src/style
directory is just for example.
My problem is upon using the bower.localFolders
options, I assume that I needed to use the same entry in bower.filesNeeded
, so if I use src/style
in localFolders
I assume that I need to use src/style/blah.css
but I just need the innermost directory, thus in bower.filesNeeded
needs to be style/blah.css
, which I thought to be a bit counter intuitive, but that's just my opinion. Maybe I'm just doesn't read the docs carefully.
You are right, but the problem is that you otherwise can't use absolute directories or directories that are one or more levels above. For example, if you had to include a folder two levels above, you'd had to add ../../myLib
as a localFolder which would be impossible to include with filesNeeded, since it would need to symlink a folder outside of bower_components
. This is a requirement for my projects which use a common shared library.
Actually it used to be like the way you described it, I changed that very recently: https://github.com/nickjanssen/angus/commit/a5e5c1576efc1af2c6415d41af1a2882d464040b
I'm not 100% which approach is the most intuitive, but like I said I had problems with this approach and that's why I changed it to the new way. If you have a better way to solve my relative directories problem, I'm all ears!
Given this config (notice the
bower.localFolders entry
):running
ls -l bower_components
result in this:angus is symlink-ing to the innermost directory, so in order to get things right in
bower.filesNeeded
you have to use different directory scheme than inbower.localFolders
, just like in the config above. Is this intentional? What if localFolder contain files in mixed directory structure? for example if some files are 2 directory down, some are 3, how do you handle that?