marceloverdijk / lesscss-maven-plugin

LESS CSS Maven Plugin
170 stars 59 forks source link

Interpret relative path incorrect #3

Open sammyhk opened 12 years ago

sammyhk commented 12 years ago

Thank your for your awesome plugin, it works perfectly, except the corresponding issue: The directory structure to illustrate the bug is following:

| - themeA/ | | - images/ | | | - background.png | | - theme.less | - config.less | - application.less 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
rquinio commented 12 years ago

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.