You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to allow the less.js to parse the LESS css files on the client you need to set the rel attribute to stylesheet/less. Doing this makes django-compressor skip the files as it looks for rel="stylesheet". It would be great to have a CSS_COMPRESSOR that we could configure that would assume the files are LESS and compress them and out put one link element with the rel set to stylesheet/less so that less.js will parse the compressed file.
The text was updated successfully, but these errors were encountered:
I'm not convinced that this should be an own feature of the compressor, but you can override the used CSS compressor class with the COMPRESSOR_CSS_COMPRESSOR setting. Refactoring the default CssCompressor class to easier define what should be considered a file to compress wouldn't be hard (e.g. elem_<elem_name> method hooks that could be re-implemented in an own subclass).
This is what I actually ended up doing. It was basically the exact same as the CssProcessor but allowing stylesheet/less when parsing the files and a new template that outputs the link element with a rel="stylesheet/less". This worked really well and allowed the less.js file to parse the resulting compressed file.
If you want to allow the less.js to parse the LESS css files on the client you need to set the rel attribute to stylesheet/less. Doing this makes django-compressor skip the files as it looks for rel="stylesheet". It would be great to have a CSS_COMPRESSOR that we could configure that would assume the files are LESS and compress them and out put one link element with the rel set to stylesheet/less so that less.js will parse the compressed file.
The text was updated successfully, but these errors were encountered: