These are chat archives for less/less.js

Jun 2017
Collin Klopfenstein
Jun 23 2017 16:58

I'm having an interesting issue with webpack's less-loader...not sure if this is the right place to ask, but I struck out in the webpack channel...

Basically, I have some places where we're using less' data-uri() function (which converts a file into a base-64 encoded string for embedding images and the like in CSS files (I'm personally against this, but that's beside the point). It works flawlessly for .svg files, but on a .png I get an error:

Module parse failed: /path/to/project/css/images/image.png Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.

LESS looks like this:

.image-bg { background-image: data-uri('images/image.png'); }

Any ideas...?