-
Notifications
You must be signed in to change notification settings - Fork 66
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
@import resources from the classpath #28
Comments
Yes, using the notation @import "classpath:..."; does work But I cannot use that notation because I'm trying to use the same .less file in production (compiled with asual engine) and in development (using the traditional less.js browser mode). Is there any way the asual engine to do this automatically behind the scenes? First try to import relative to working directory, then check the classpath if unable to find the file. |
It will be great if you can do this with relative paths. I will check if a classpath fallback is possible. |
Thanks. Something as simple as wrapping the call in a try-catch block and then checking the classpath (both with the "classpath:" notation and without) should work. |
This can be implemented using the changes introduced with #32 You need to override the default resource loading configuration by adding a variant of import com.asual.lesscss.loader.ClasspathResourceLoader;
class ClasspathFallbackResourceLoader
extends ClasspathResourceLoader {
ClasspathFallbackResourceLoader(ClassLoader cl) {
super(cl);
}
@Override
protected String getSchema() {
return "";
}
} then you can combine it with regular |
I cannot @import a file from a different folder (but on the classpath).
How does the LessEngine load files for @import?
Example:
@import "test.less"
where test.less isn't in the same folder but its parent is added to the java classpath?
The text was updated successfully, but these errors were encountered: