How to configure less in webstorm

First of all, you need to have node and npm environment, if you have to download it first.
https://nodejs.org/en/
then download less
Insert picture description here

cnpm install less -g
npm install less -g

cnpm uses Taobao mirror-g global download
. Copy the above address first, mine is this: C:\Users\18309\AppData\Roaming\npm\lessc
then look at this picture: Insert picture description here
copy the above path and add it later.cmd

 C:\Users\18309\AppData\Roaming\npm\lessc.cmd

Mine is this, and then restart.
Create a new less file and Insert picture description here
write something, such as mine:

body{
    
    
  width: 100px;
  height: 100px;

  div{
    
    
    color: red;
  }
}

Then you will find 2 more files,
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43612538/article/details/108782578