How does webpack package the background image into base64 and replace it in css?

A very simple project is not created with scaffolding.
scenario: there is only one css and one js page, but there are many background images and multiple html files.
requires: replace small icons with base64, compression css, js, html, but do not merge.

I tried many times. As a result, I merged css and img into js.) o
I read the document, but I don"t quite understand. How should I write it?

Dec.26,2021

css needs to be extracted through plug-ins.
pictures can be processed by url-loader , and those that are smaller than a certain size can be encoded by base64

.
Menu