Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

less not getting processed in development #11

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

less not getting processed in development #11

johnlabarge opened this issue Jan 29, 2012 · 5 comments

Comments

@johnlabarge
Copy link

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
Copy link
Owner

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

@johnlabarge
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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

@johnlabarge
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants