On the problem of using style= "background-image: url ('xx.png') to introduce pictures in html files in webpack

in css files, you can directly use url-loader to solve
use picture tags in html you can use html-loader or html-withimg-loader to solve
but what is the solution to introduce pictures using element background in html? < div style= "background-image: url ("xx.png") > < / div >

Note: not react and vue projects, but traditional template page packaging
Jun.20,2022

with ejs-loader, you can write something like: <% require ("xxx.jpg")% >


can I add require?
url (require ('xx.png'))


set alise to @ in resolve in the webpack configuration, and then use url ("@ / assets/xxxxxx") in the project. Or you can use ~. This is currently used in
vue. Url ("~ @ / assets/xxxxxx")

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf6097-53660.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf6097-53660.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?