Like when you build with webpack to convert the contents of the img tag in base64?

Good day!
When meeting with webpack faced with the fact that I can not win is not the most complex, I think the challenge is to take from the html file the image with src="...image.png" and convert it to the output file in the picture with base64.
Very vague idea in which direction to go, I would appreciate any tips.
June 7th 19 at 14:50
1 answer
June 7th 19 at 14:52
Solution
All that is needed for movement, this is all I want to pass through webpack to do it using import / require.
<img src="{require('path/to/img.jpg')}">

The rest can be read here (EN). There at the same time an example and css.
5a990cee13809799287869.png

I tried, but the Assembly ignored this year :( - Aniya commented on June 7th 19 at 14:55
and initially-that's where the Shoe pinches? from js file? or is it the html file you are trying to feed in webpack? To version 4 webpack can not html as the entry point to take, and in the 4th he was still too inexperienced, but already promise. That is, all the js files. - dannie.Stehr commented on June 7th 19 at 14:58
, wempack 3.4.1, entry point of js - Aniya commented on June 7th 19 at 15:01

Find more questions by tags Webpacknpm