Open melcher opened 11 years ago
@melcher I see. Let me explain - the word type in byType
layout refers to sections in exportsOverride
.
Consider the following example from docs:
"exportsOverride": {
"bootstrap-sass": {
"js": "js/*.js",
"scss": "lib/*.scss",
"img": "img/*.png"
},
"requirejs": {
"js": "require.js"
}
}
js
, scss
, img
- are types. Please note, that type ≠ extension. The following line from the example demonstrates this fact: "img": "img/*.png"
.
byType
layout will not work until you describe override rules for your libraries in exportsOverride
section.
By the way, we see that our current wording causes a lot of confusion, so we are going to improve docs / restructure the task itself to make it more user-friendly.
Basically without an override there is no type because nobody specifies main
files in bower by type (yet).
@reggi how one could specify main
files by type in bower.json
?
@heruan Not sure what you're asking.
In bower.json
you can set for example "main": "path/to/main.css"
but I don't think there's support for / nobody ever sets "main" files by type for instance like this:
"js": "js/*.js",
"scss": "lib/*.scss",
"img": "img/*.png"
I understand @melcher's confusion. exportOverrides
is under the Advance Usage section of the documention. I feel like this leads the user to think that they get the directory structures specified under byType
and byComponent
for free. With my initial usage, byComponent
is used even if layout: 'byType'
is set (without setting exportOverrides
).
Maybe having the directory structure for a few common types (js, css, fonts, images) baked into byType
would help? Mostly taking cues from the Rails asset pipeline.
Ah yes, makes sense. I definitely assumed it would do basic asset-type matching by extension without needing to specify it per-library. Thanks.
@melcher did this solve your problem?
Just running the default task, both with no options and with manually setting layout to "byType", it does not group the files by type. Hoping someone can help!
My Gruntfile.js