Answer the question
In order to leave comments, you need to log in
How does image assembly work in Webpack?
Hey!
Tell me, how does saving images work logically in Webpack?
Let's say there are 100 pictures on the site.
I figured out only with a cumbersome assembly of pictures:
1) Each one must first be imported into index.js
import "./img/1.jpg";
import "./img/2.jpg";
import "./img/3.jpg";
...
import "./img/100.jpg";
<img src="./img/1.jpg">
<img src="./img/1.jpg">
Answer the question
In order to leave comments, you need to log in
Try instead:
Here it is:
<img src="./img/1.jpg" />
<img src=<%=require("./img/1.jpg")%> />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question