Support for files not ending in CSS or JS
jeff-ottinger opened this issue · comments
This is just a suggestion.
I recently ran into an issue adding the following css file to the 'autoload' array:
I was able to work around this issue by adding a parameter with '.css' as the value so that the regex would pick it up, like this:
However, this isn't very clean. Here are two options:
- Add two new config options 'autoloadcss' and 'autoloadjs' which force the associated array items to be loaded as either CSS or Javascript
- Add support for a 'js' or 'css' key to the 'autoload' array, which would contain a sub-array of the items you want to force loaded as either CSS or Javascript.
Thanks
@jeff-ottinger I just changed how the asset type is determined to a much more flexible approach.
Now instead of using the extension the filename/url is matched against a regex pattern than can be customized via config options. So now you decide what is a JS/CSS asset, not me or the extension.
You can see the default values for the regexs in the API docs.