HBuilder: Install and use Less

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

insert image description here

(2) Install using hbuilder

At this time, HBuilder will report an error, and npm install fails.
insert image description here
Solution
Find the compile-less folder in the hbuilder directory, and manually execute npm install.
insert image description here
How to execute npm install?
cmd (command prompt), run as an administrator (get used to it), switch to the compile-less path, npm install
insert image description here
[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

insert image description here

(2) Reboot! !

3. Summary

The tutorial I was looking for before did not mention restarting. After a long time, remember to restart! !

Guess you like

Origin blog.csdn.net/qq_38432089/article/details/125217615