D
D
dmitry20002021-08-05 01:41:38
webpack
dmitry2000, 2021-08-05 01:41:38

Webpack 5 pictures?

How to work with images and background images in Webpack 5 now? I do it on the dock , the paths are the same, but it gives an error

Can't resolve './location.svg' in 'C:\Anton\Web\Sites\Webpack\src\scss'

Does he look for them in the scss folder? How to make them normally, in the images folder, as before, but now it automatically copies all the pictures without a folder. And so that the site displays
610b269a1b2ee598403444.png
Now webpack creates everything at the root. Including js file from the assets folder. As are the pictures. How to make it the old way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2021-08-05
@delphinpro

You are specifying a relative path.
The path from the stylesheet.
./means that the image is in the same folder as the scss file.
Just enter the correct path to the image, and you will be happy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question