-
Notifications
You must be signed in to change notification settings - Fork 339
Add cascading alternate search paths to fix preprocessor workflow #133
Comments
A good workaround from @aligo:
This could be a permanent solution. Because it adds both file paths, not a cascade, naming collisions would cause issues, but naming collisions should be avoided anyways. |
the workaround is fine, unless you app/.tmp folder locations are configurable. then the config is thrown out the window because it wont find them if they are changed. We need to have an option in the config for cascading alternate search paths |
True, a configuration option is the real fix. @sleeper, is there something like this in 2.0? |
Not yet, but I would say "almost" (i.e. most of the code already exists). |
The workaround from @robwierzbowski's earlier comment no longer seems to work in 2.0.0. Is there an alternative approach that should be used? |
i was hoping this would be fixed by now :( |
Me too, so I should probably DIY for OSS FTW. I'll try and roll a PR this weekend. |
: D thx |
I'm not sure if that's a good place, but I'm having an issue with alternate search paths. I've got I solved it for now by changing |
@szimek Did you solve it. I'm having the same issue right now. Outputting all my css twice. |
The simple but hackey solution is to give your preprocessor files an On Tuesday, April 15, 2014, Brian Gerstle [email protected] wrote:
Rob Wierzbowski |
any news here? need that too |
This would be a really cool feature. It might be be even better to have an optional explicit search paths for scripts/styles? eg. I'm using grunt-modernizr and it generates a customised modernizr for dist.
I would like to write something like
So that the modernizr.js path would instead be .tmp/modernizr-custom.js Another thought is if we put ignore comments around script(s)
So usemin would completely ignore the script(s) and the configs in concat, uglify and css, etc somehow will append to usemin generated config. |
I'm also now finding the the alternate search workaround fails. It only seems to search the first directory (even though the config shows it should search both).
|
Adding the feature tag. Others things in the pipe before. |
+1 i need this too |
This was originally posted in the Yeoman issue tracker, and has been requested in a couple other issues indirectly; I'm reposting here so we have a centralized issue with references and use cases.
Problem
Usemin looks in one directory for every item in a usemin block. When using a CSS or javascript preprocessor, your processed CSS and JS files will be in a different directory than vanilla CSS and JS. This makes it difficult to concatenate preprocessed CSS and JS with vendor or component files without an extra copy step to put them in the same directory.
We can add an alternate path for the block, for example
build:css(.tmp)
, but this doesn't solve the problem of having files in two entirely different root directories.Solution
The
server
task solves this by looking for a file in a cascading list of directories, and using the first one it finds. We can duplicate this pattern for the build step by adding a cascading list of alternate directories in the usemin block.Notes
This was first proposed in yeoman/yeoman#959.
It solves yeoman/generator-webapp#12 (comment) and yeoman/generator-webapp#31.
@aligo did some similar work in #116. Their patch uses an attribute in the link or script tag; I think the original proposed syntax is cleaner, but maybe they have some insights or would be interested in helping implement this syntax.
The text was updated successfully, but these errors were encountered: