-
Notifications
You must be signed in to change notification settings - Fork 1
data-uri function not working #5
Comments
Hi, |
Thanks for replying! I attached a ZIP archive ( I also attached my fix ( |
I tested your solution and it works. The only problem is that resources paths must be relative to working directory... Unfortunately it will be difficult to fix it. I have an idea (a new vision for LessCSS Compiler library) but I need to consult it with one colleague from my work. For now you can use workaround:
|
Thanks for looking into my solution! I will give feedback on your workaround as soon as I am able to try it out. It's currently not super urgent to have a fixed and running version of the Less compiler for my project. But I am still looking forward to use the fixed Less Compiler on it's next official release without the need of any workarounds. |
Ok. I fixed (with your help 😄) support for
|
Hey, Thanks for fixing it so quickly! |
- add information about fix in 2.0.0 changelog
Hey,
I'm using your plugin to compile my Less sources. I tried to make use of the
data-uri
function (docs see here) that Less provides, but I could not get it working. The plugin keeps on throwing the following error:The line (5) the error message is refering to is the exact position in my Less file where I used the
data-uri
function.I invastigated the issue and came to the following solution:
1. Fixing: Cannot find module './fs'
This issue lies in your
lesscss-compiler
project, more specifically inless-rhino-1.7.5.js
. Thefs
module is defined, but requiring it viarequire('./fs')
is simply not working. When invoking the stubbedrequire
function with a module containing a/
the implementation will not look inless.modules
(where the fs module is defined). Therefore changingrequire('./fs')
torequire('fs')
(see position in code less-rhino-1.7.5.js:2679) will resolve this issue.2. Fixing: Cannot convert org.mozilla.javascript.NativeArray to byte[]
When (1) was fixed I instead got a similar issue as described here. To fix this issue I had to make changes to the
encodeBase64String(String)
(see position in codeless-rhino-1.7.5.js:143
. I changed theencodeBase64String(String)
like this:After those two fixes I was able to use the
data-uri
function. One still has to tell the maven plugin where to find the resources to be data-uri'ed by either using absolute paths or placing the resources insidetarget/gabrys-biz-lesscss-maven-plugin
.Is there any chance the
data-uri
function will be fixed in a future version? I could also send a pull request with my fix, if you wish.The text was updated successfully, but these errors were encountered: