grails-lesscss-resources icon indicating copy to clipboard operation
grails-lesscss-resources copied to clipboard

less not getting processed in development

Open johnlabarge opened this issue 13 years ago • 5 comments

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.

johnlabarge avatar Jan 29 '12 04:01 johnlabarge

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

paulfairless avatar Feb 02 '12 20:02 paulfairless

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: <r:require module='entry'/>

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 avatar Feb 07 '12 20:02 johnlabarge

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.

johnlabarge avatar Feb 07 '12 21:02 johnlabarge

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

e.g: /less - main.less - other.less

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

paulfairless avatar Feb 07 '12 23:02 paulfairless

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..

johnlabarge avatar Feb 08 '12 01:02 johnlabarge