lltyk / tapestry-wro4j

Web Resource Optimizer integration for Tapestry 5.3
Other
12 stars 4 forks source link

less import #2

Open ribrewguy opened 12 years ago

ribrewguy commented 12 years ago

I cannot get the import to work. It appears to expect an absolute path which impacts portability quite a bit and is impractical. This may be a limitation or wro4j, but it'd be great to see a workaround here.

lltyk commented 12 years ago

Can you give me an example?

ribrewguy commented 12 years ago

Actually I can't get this to work even with absolute URLs.

I'm trying to abstract common less settings. Given the following dir structure:

src/main/webapp/css/defs.less ................................main.less ................................other.less

In the main.less file if I begin the file with @import 'def.less';, or @import '/css/def.less'; or any other way I can think of the console dumps an error like this:

Caused by: java.io.FileNotFoundException: /Users/torr/workspaces/project/src/main/webapp/css/defs.less (No such file or directory) at java.io.FileInputStream.open(Native Method) ~[na:1.6.0_29] at java.io.FileInputStream.(FileInputStream.java:120) ~[na:1.6.0_29]

I cannot get it to include any other less files.

alexo commented 12 years ago

Possible solution: pre process @import statements before applying the lessCss processor. wro4j provide CssImportPreProcessor but it is quite coupled with wro4j internals. I'm looking forward to make it as reusable as possible.