paulfairless / grails-lesscss-resources

Grails plugin for using the LESS CSS framework in conjunction with the grails-resource plugin family
Other
35 stars 27 forks source link

less not getting processed in development #11

Open johnlabarge opened 12 years ago

johnlabarge commented 12 years ago

When I followed the instructions, even though the log statements indicate that less is being compiled to css, that's not what is served by tomcat when I run the app (plain old less is served). I'm running grails 2.0.0. Not sure if this is an issue with where I keep my less files or not.

paulfairless commented 12 years ago

It sounds like a configuration isuue, if you add your config then I will see if I can replicate

johnlabarge commented 12 years ago

I just did a basic install of the plugin and put my less resources in web-app/less (as seems to be implied by the documentation).

This is what I have in my AppilcaitonResources.groovy: entry {

    resource url:'less/spash.less', attrs:[rel: "stylesheet/less", type:'css'], bundle:'entry_style'

}

This is what I have in the GSP:

The less file is located at web-app/less/splash.less.

One more thing: The console:

| Error 2012-02-07 15:08:26,863 [Thread-8] ERROR resource.ResourceMeta - Resource not found: /less/spash.less

Any hints?

johnlabarge commented 12 years ago

Ok I'm retarded. That was a spelling mistake, but I have an actual issue now that I don't know how do use the @import feature of less. The imported less files do not seem to be importing.

paulfairless commented 12 years ago

The import directive should have a relative path based on the location of the main .less file

e.g: /less

then in main.less @import '@other.less';

johnlabarge commented 12 years ago

yeah I got that to work, turned out I had a compile error that was hidden because of the 'printStackTrace()' call in the plugin code. I changed it (in my local copy) to log.error e (first e.stackTrace.join("\n") but there was nothing good in there).

The two remaining issues I have are 1) I have to re-build/run every time I change the file and 2) There aren't great error messages coming out of the compiler.

I thought I may make a tweak for it to use the javascript less interpreter if the environment is develompent which would give me the ability to change files on the fly and friendly error messages, and use the resource compilation if the environment is staging or production. I can let you know how I fair..