** In actual development, the introduction of pictures generally have two, IMG and Background-Image,


The class name Hulu1 here is changed to Hulu;
Then install File-Loader
method:npm install file-loader -D
Configuration:


**
Note that when IMG is introduced, you must use the picture as a module like this, first import it to IMG.SRC
**
The configuration method is the same as Background-Image, does not need to be configured.
Then execute the command, two pictures are packaged under the build folder, and WebPack will automatically find the packaged file path and do not need to be modified.

Like File-Loader, it can convert a smaller image of a file to a Base64 bit URI.
Use mode and configuration as File-Loader basically
Just change file-loader to url-loader, right, premise is also installed URL-Loader




Webpack is written in JS and runs in a node environment, so by default, only the dependencies between JS will be processed when webpack is packaged! ! ! If you don’t believe it, you can create a...
If the url-loader exceeds imit, it will fallback, so the file-loader configuration must be written in the fallback. If you finish writing the url-loader configuration and then write the file-loader as...
npm install --save-dev [email protected] Configuration in WebPack.config.js npm install --save-dev [email protected] Then add it in WebPack.config.js publicPath: 'dist/'...
Custom loader...
Installation webpack Webpack command execution npx command that the implementation of the project in webpack node_modules commands executed directly webpack otherwise, you will need to install a globa...
Original address:https://webpack.js.org/loaders/url-loader/ webpack version: 2.2.1 Converting image files to base64 encoding and loading into the browser can reduce the number of http requests, but in...
...
...
Installation url-loader file-loader is dependencies. In the images folder to put a picture, test.jpg Configuration rules are as follows: The third is to configure the URL, Compare our multi-format mat...
1. Webpack image file processing 1.1, picture file processing method 1: url-loader 1.2, picture file processing method 2: file-loader 1.3. Image file processing-modify file name Generate file storage ...