I am using Grails 2.1.0 and lesscss-resources 1.3.0.3
I have created a plugin containing a less and several css files, having lesscss-resources plugin installed + explicit plugin dependency to the same.
Another Grails project has my custom plugin installed and the very same lesscss-resources plugin.
When running the plugin alone, all css files and the less file are merged correctly into one css file.
When running the other Grails project, only the css files are merged – but the less file is linked untouched as less file like this:
<link href="/myproject/css/mystyle.less" type="text/css" rel="stylesheet/less" media="screen, projection" />.
However, less resources within the project are merged fine.
Shouldn’t the less resources of the plugin be merged, too? If not, is there a workaround? I’d be happy for any ideas how to solve this – I do not have a clue where to look in order to find the root cause of the problem…. Thanks a lot.
By the way, I am not talking about the issue described here: https://github.com/paulfairless/grails-lesscss-resources/issues/25. I have already stumbled over this one and added the dummy.css, which works fine for me.
Related plugins installed in plugin and project:
- runtime “:cache-headers:1.1.5”
- runtime “:cached-resources:1.0”
- runtime “:lesscss-resources:1.3.0.3”
- runtime “:resources:1.1.6”
- runtime “:zipped-resources:1.0”
EDIT:
FYI: In the meantime I did some more testing and reproduced the issue with the least amount of code. As this seems to be very specific to the lesscss-resources plugin, I have raised an issue at https://github.com/paulfairless/grails-lesscss-resources/issues/36
I’ll update this question with any information that might pop up over there. If anyone has an idea, I’d still be happy to hear it, I’ve uploaded the least-amount-of-code project and plugin here:
http://www.2shared.com/file/4OM-RVC6/lesstest.html
EDIT 2:
I have not received a response yet, but found a workaround that works for my use case, at least.
Unfortunately it involves changing the code of the lesscss-plugin. See my comment at https://github.com/paulfairless/grails-lesscss-resources/issues/36#issuecomment-8721813
As there is still no feedback on the issue mentioned above, I add my workaround as answer for now.
I got it working by copying resourceMappers.LesscssResourceMapper to my plugin projecct (i.e. overriding the default behavior of the lesscss-resources plugin) and changing line 24 to say
instead of
This way, everything works fine for me. As far as I can see, no side effects should emerge from this change.