1. Install the Less plugin
(1) Menu bar: Tools, plug-in installation, install new plug-ins, go to the plug-in market to install, search for Less
(2) Install using hbuilder
At this time, HBuilder will report an error, and npm install fails.
Solution
Find the compile-less folder in the hbuilder directory, and manually execute npm install.
How to execute npm install?
cmd (command prompt), run as an administrator (get used to it), switch to the compile-less path, npm install
[I have set up the Taobao mirror before, so the download will be faster]
(3) Restart hbuilder
It will not take effect without restarting! !
2. Configuration
When the .less file is saved, the corresponding .css file will be automatically generated
(1) Modify the package.json file
(2) Reboot! !
3. Summary
The tutorial I was looking for before did not mention restarting. After a long time, remember to restart! !