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

The ability to use the gulp-less-changed without data-uri #43

Closed
margo-nik opened this issue Jul 12, 2019 · 6 comments
Closed

The ability to use the gulp-less-changed without data-uri #43

margo-nik opened this issue Jul 12, 2019 · 6 comments
Labels

Comments

@margo-nik
Copy link

hi there

I have a different level of nesting of less files and imports in my project. And when the plugin checks the data-uri, it checks the validity of the URL. But (because of the different level of nesting of files) this may be an invalid URL and then the plugin will return an error. If you put the correct URL - less will not compile base64 from this URL

An simple example:
file _variables.less ( ./styles/base/_variables.less)
@icon: data-uri(../../img/icon.svg);

file styles.less (./styles/styles.less)
@import 'base/_variables'

and icon.svg (./img/icon.svg)

In this case plugin will ok, but in the sourse file data-uri dont compile becouse its invalid url for source file.
if we put @icon: data-uri(../img/icon.svg); Plugin will return an error

Maybe you have an idea how to fix this? Or you can add to the plugin the ability to disable the data-uri. it would be great!
thank

@bingnz
Copy link
Owner

bingnz commented Jul 14, 2019

Hi @MargoNikk,

I can't really tell from your description what's going on here.
As you can see in this test, the plugin does support data-uri.

To help troubleshoot this:

  • Does it work as you expect if you don't use the gulp-less-changed plugin at all? In other words, does the less plugin support what you're trying to do?
  • All the examples I've seen for using data-uri have the path in quotes. Have you tried using quotes?

If you try the above and it does work with less itself but not with the plugin, then please attach a .zip file and I can take a look.

Thanks,
David

@margo-nik
Copy link
Author

Hello, @bingnz ,

Sorry, I will try to explain in more detail.
In the example above, I really forgot the quotes. But it does not matter. because in the real example there are quotes. and plugin I use as it should
The plugin works as expected and works well! Thank you for it.

But I have issue with data-uri. I attach an example file with code comments.
v_example.zip

Now there is a code that I need. Compilation result: http://joxi.ru/Q2K4X37CLaaLNA
if we fix it we will follow this:
1)http://joxi.ru/82QM815TwbbyO2
2) Result: http://joxi.ru/EA41wGvToqqo1r

It would be great to be able to turn off the compilation of datа-uri if desired.

Thanks,
Margo

@bingnz
Copy link
Owner

bingnz commented Jul 14, 2019

Hi @MargoNikk,

Thanks for the detailed information!
I can prepare a fix for this. In the meantime there are a couple of workarounds.

  1. You can use the less rewriteUrls option, like this:
    rewrite-urls-option.zip.
  2. You can make the URLs relative to the root, like this:
    urls-made-relative-to-root.zip.

Thanks,
David

@bingnz bingnz closed this as completed in 33082fd Jul 14, 2019
@bingnz
Copy link
Owner

bingnz commented Jul 14, 2019

🎉 This issue has been resolved in version 1.4.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bingnz
Copy link
Owner

bingnz commented Jul 14, 2019

@MargoNikk please feel free to reopen this or create another issue if it doesn't solve your problem.

@margo-nik
Copy link
Author

Hello, @bingnz !

Thank you so much for the advices and for the fix! Evrything is work and good:)

Best Regards,
Margo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants