Packaging webpack resources (resources and introduced css html introduced resource) disposed use of

Webpack recently doing a small project file packing case

Met questions are as follows:
. 1, the HTML img src introduction of the [ 'object, module'] in the case
2, for introducing an error css package file resource issues into the correct path, but image placement error address

For the first Question 1 is as follows:
Here Insert Picture Description
picture pack address is correct situation
Here Insert Picture Description
occurs because this problem is because file-loader version is too high, the highest version 5.1 I am currently developing, so I will be reduced to version 4.1.0 file-loader after the problem is solved.
Here Insert Picture Description

For Question 2 this case I also find a lot of solutions.

First, find the problem is that when the CSS and html packaging when packing is to go url-loader were packaged and limit the amount of which will be less than the set limit value packed into CSS directory, which is greater than the value set will be packaged into under the path, I have here is in accordance with the original path output. Here Insert Picture Description
So this is the reason a situation that caused the error, but because we can not consider the introduction of picture images of different sizes and introduction (the introduction of the use of CSS or html introduced), it is unlikely to set the limit line.
So they continue to find the real source of the problem lies in the path after picture package misplaced
so the final solution to resolve css or scss path is set, as shown below
Here Insert Picture Description

So the problem is resolved.

I hope you encounter problems when packaged able to think about their problems and ideas to find the problem, but also you can see more detailed official end of the document.

Published 19 original articles · won praise 58 · views 50000 +

Guess you like

Origin blog.csdn.net/cyg_l02/article/details/103325127