Webpack picture path problem

<head>
<style>
body {
    background: url("");
}
</style>
</head>

or

<div style="background: url("");"></div>

how webpack handles inline or inline style background map paths

Jul.23,2021

I introduced it directly with a relative path.


if another picture is generated after npm run build, an img file will be generated

  • static

    • img
    • js
    • css
  • index.html

url-loader handles the path in the code, limit sets the limit of the picture, and the picture is converted to base64

.

encountered the same problem. Have you solved it

?
Menu