Loader: Can be synchronous asynchronous, can be used in the Nodejs, with parameters, can let webpack to do what it does not support such as the style-loader we used before, the common way is in Webpack.config.js loader configuration
Installing BABEL-LOADER:NPM install--save-dev Babel-loader babel-core
3. Installing LATEST:NMP Install--save-dev babel-preset-latest
4. Can be configured in the Package.json latest, can also be directly written in Webpack.config.js
"Label": {
"Presets": ["latest"]
}
5. Deal with some CSS not easy to be parsed by the browser things we need to install after the processor NPM install Postcss-loader--save-dev
POSTCSS plugin autoprefixer npm install autoprefixer--save-dev
6. Use the less file to install NPM I less-loader--save-dev
7. Working with a static HTML template file requires installing NPM install Html-loader--save-dev
8. Processing the Ejs template file requires the installation of Ejs-loader, and the loader is configured in the Webpack-config file.
9. Processing picture File Installation File-loader
9.1: Working with images introduced in CSS
9.2: Picture introduced by the way IMG is processed
9.3: The reference picture in the component (if you want to use a relative path requires ${require ('. /img/aa.png ')})
10. Install Url-loader, similar to file loader but he can specify a limit parameter, when your file and picture is larger than your specified limit, it will be executed to file loader, when your file is less than limit It will automatically be converted into a base64 encoding.
11.image-webpack-loader Compress pictures, but must be used in conjunction with Url-loader or File-loader
Webpack working with resource files in a project