CodeSleeve / asset-pipeline

This Laravel 4 package provides a very simple and easy to use asset pipeline. It was heavily inspired by the Rails asset pipeline. We make use of the wonderful Assetic package to help with pre-compliation!
http://www.codesleeve.com
MIT License
489 stars 53 forks source link

CSS from a sub directory of a custom mixed library directory is served as JS #57

Closed eviweb closed 10 years ago

eviweb commented 10 years ago

Hi,

when using a custom library containing both scripts and stylesheets (see an example of configuration below)

 'paths' => array(
     '/custom/mixed/library/directory' => 'javascripts,stylesheets',
  ),

a request for a css file contained in a sub directory (ie css/requested-file.css) results in serving it with the content type : application/javascript.
This comes from that the validation process of file extensions is not constrained to stylesheets (in that case) and javascripts are checked first.

The provided fix is a little bit elaborated than simply hard-coding types, but it should be more flexible.

kdocki commented 10 years ago

Merged into testing... will merge into dev-master later if things checkout.