search

Home  >  Q&A  >  body text

javascript - Questions about webpack packaging

After using webpack to package static resources, please ask how to set the path for some larger image resources.

Because relative paths are used to find resources during development, and this image is relatively large and cannot be packaged into bundle.js.

Then when I put the project in the server, the resource cannot be found. How can I set it up to package and reference it normally. I tried to change the url (../../images/bg-0.png) to the address url (/static/images/bg-0.png) on ​​my server, but because I need to find the path when packaging, this path If it is abnormal, it cannot be packed immediately. . . . Please tell me how to set up large pictures.

扔个三星炸死你扔个三星炸死你2706 days ago667

reply all(1)I'll reply

  • 某草草

    某草草2017-06-24 09:45:12

    If the image resources and code are separated and it is not possible, use the full URL path

    reply
    0
  • Cancelreply