1. install dependencies
npm i style-loader css-loader less-loader less -D
2. Create html page
<html> <head> <meta charset="UTF-8"> <title>index</title> </head> <body> </body> </html>
3. New index.less file
html{ background-color: blue; }
4. Reference index.less in the main.js
import './css/index.less'
The configuration file webpack.config.js
module: { rules: [ { test:/\.less$/, use:['style-loader','css-loader','less-loader'] } ] }