less not getting processed in development #11

Open
johnlabarge opened this Issue Jan 29, 2012 · 5 comments

Comments

Projects
None yet
2 participants

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.

Owner

paulfairless commented Feb 2, 2012

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

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?

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.

Owner

paulfairless commented Feb 7, 2012

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';

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment