documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

js_source_directory and css_source_directory #232

Closed jdeerhake closed 12 years ago

jdeerhake commented 12 years ago

Add configuration options to automatically prepend a directory to each of your JS and CSS files. Just trying to DRY up the config file a little bit so that something like this:

    - public/stylesheets/compiled/ui/action_sheet.css
    - public/stylesheets/compiled/ui/modal.css
    - public/stylesheets/compiled/ui/loading_modal.css
    - public/stylesheets/compiled/ui/slide_out_menu.css
    - public/stylesheets/compiled/mobile/global.css
    - public/stylesheets/compiled/mobile/checkout.css
    - public/stylesheets/compiled/mobile/onboarding.css
    - public/stylesheets/compiled/mobile/events.css

Could be turned into this:

css_source_directory: public/stylesheets/compiled/
    ...
    - ui/action_sheet.css
    - ui/modal.css
    - ui/loading_modal.css
    - ui/slide_out_menu.css
    - mobile/global.css
    - mobile/checkout.css
    - mobile/onboarding.css
    - mobile/events.css

I'm not much of a rubyist so I'm sure this could be done in better ways, but it's feature I'm starting to badly need for a large site.

jashkenas commented 12 years ago

We've thought about this -- but it's nice for YAML to be YAML, and not magic preprocessed configuration.

Instead, simply take advantage of the globs.

- public/stylesheets/compiled/**/*.css