-
Notifications
You must be signed in to change notification settings - Fork 27
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
adding support to compile less files inside a plugin #7
base: master
Are you sure you want to change the base?
Conversation
I have added support to inline pluglins. This is when the less files to be compiled live on an inline plugin |
I've also run into this issue. Some brief testing last week seemed to indicate that the above code still works, but doesn't work for a binary plugin. |
hi Ben, I've made some extra changes that might have fixed the problem you're having, however I have not pushed them to github yet, I will do it tomorrow as I'm not currently at my office. |
I assume this change would fix a problem we are having trying to use the bootstrap plugin. Namely, we want to install the plugin for the majority of the bootstrap files and then just override the few that need customizing in our application. Also, we need to import some of the mixins for use in our own custom LESS. Right now, the plugin doesn't seem to be able to resolve things inside the plugin when doing an import. |
+1 vote for integrating this - I'm having the same issue. less files are compiled when I run my plugin standalone, but as soon as use my plugin in another application, I get nothing. Interestingly, the exact same issue affects the other less resources plugin (http://grails.org/plugin/less-resources) |
+1, need a fix for this. The other less-resources plugin has it's own issues, so right now I can't use either. |
+1 |
Hi all, There was an issue for the version 0.6 of this plugin, where it was unable to find less files when they lived inside a plugin, this version attempts to fix this problem however as far as I've tested the newest version of this plugin solves the issue mentioned above. Another issue I was having which isn't fixed on this version nor on the newest version of this plugin is the inability of importing mixins from other plugins inside less files. In our case we have a core plugin which holds base js, less, shell|templates (gsp), then we have other plugins or apps which make use of those base files. A cool feature that we needed in order to get the most flavor out of less was the ability to import seamlessly mixins in less files from the core plugin. So if some of you are facing the same situation let me know and I will commit a version which solves this case with some examples, Hope this helps |
Which plugin does it work right now? yours? or Paul Fairless's plugin? Can you commit your fix to solve these issues? I was struggling with this problem with this and less-resources plugin for a few days and I don't know what else to do... Martín Caballero |
both this version and the newest one (Paul Fairless's) solve the problem of having the less files living inside a plugin however neither of them allow you to import mixins from a plugin to either an app or another plugin. I explain a little bit further the case that is not supported, for example you have plugin A which contains a less file to be imported: _toBeImported.less .bordered {
border-top: dotted 1px black;
border-bottom: solid 2px black;
} Then you have another plugin b which contains @import "_toBeImported";
#menu a {
color: #111;
.bordered;
}
.post a {
color: red;
.bordered;
} I have a version that solves both cases but it still in progress however we are using it on a production site and works like a charm, will commit it this week, you may find it useful |
Thanks for the response! |
jvalde, It stinks that both less plugins have issues that prevent them doing what we need right now. Namely, I just want to use bootstrap as a plugin and import mixins, etc. to use in my application stylesheets. |
Here's how to replicate the problem I'm seeing. Do the following (in grails 2.0.1, at least):
Is there anything wrong with this example? I don't think I can break it down to be much simpler. I've tried many other avenues, and the bottom line is that I can't get less files to compile if they're in a plugin, period. |
I tested version 1.3.0.3 of this plugin and could not get LESS resources within a binary plugin to be compiled, I tested defining the resource both within the plugin and within the web-app which uses the plugin. If I changed the plugin definition in BuildConfig.groovy to be inline (which AFAIK is the same as a source plugin) then the resources could be compiled. jvalde, I don't see a recent commit from you, but you mentioned above that you had some code which might fix this issue? |
+1 @jvalde or anyone else who can help, please fix the ability to import .less files from plugins! I need to selectively override small parts of twitter-bootstrap (e.g. parts of variables.less), but @import just doesn't work in my custom .less files, the twitter-bootstrap resources (provided by the plugin) just can't be found. Thanks very much in advance for any help! |
I would like to hear from anyone who has news about getting less resources accessible to a grails app from a binary plugin. @jvalde - do you have anything to share? |
Hi Paul,
Thanks for your contribution this plugin made our work possible,
we are working using a plugin oriented architecture where we have a core plugin which provides common resources as templates, css, javascripts and images, the plugin works great when using it on the main application (the less files live on the main app) however it fails when the less files live in a plugin, because it can't work out the right path,
I have added support for this case, when you got a plugin that uses lesscss-resources that then is then installed on another application,
There is something dodgy that I don't like on code that I committed and it's the way that I used to find out whether the resource lives on a plugin I had to rely on the sourcePath, as far as I've seen the object ResourceMeta does not provide a pluginName property (the name of the plugin passed in the resource for instance "resource url:[dir:'css', file:'basic.less', plugin:'basic-core'], bundle:'bundle_style'") which would be ideal for this case,
Please check the changes and let me know your thoughts,