lesscss-maven-plugin
lesscss-maven-plugin copied to clipboard
Interpret relative path incorrect
Thank your for your awesome plugin, it works perfectly, except the corresponding issue:
The directory structure to illustrate the bug is following:
In themes.less, it configuration the less variables used by application.less, for example: @image-url: "images"; @background-image: url("@{image-url}/background.png");
In the config.less, it declare which theme should be used: @import "themeA/theme.less";
In the application.less, it only dependence on the config.less so it can use the theme related variables: @import "config.less"; .demoDiv: { background: @background-image; }
The above example works fine in the client side by including less.js, which will interpret the background image url as: http://mydomain/css/themeA/images/background.png While switching to use maven lesscss plugin to generate css in compile time, it interpret the background image url wrongly as: http://mydomain/css/images/background.png
I faced similar issue. It seems less.js does not handle relative paths the same way in browser mode and outside... cf. https://github.com/cloudhead/less.js/pull/331 So had to keep all less files in same folder and configure the plugin to compile only the "root" ones.