1. Computer installation node.js
environment;
directly under the window on the official website to download the installation file to download node.msi
after installation at the command line execute the following command indicates that the installation was successful
npm -v
node -v
2. Global Installationless
npm install -g less
3. Configurationidea
3.1 installation nodejs
plug
Open idea
→ settings
→ plugins
installation: nodejs
plug, configured according to the following steps:
After installation, reboot idea
3.2 Adding less
Components
- Open
idea
→settings
→Languages & Frameworks
→Node.js and NPM
; - Click on the right side of the panel that opens
+
plus button to add the requiredless
components (if not add here, use the command npm globally installed).
3.3 Installation file watchers
Plug
Open idea
→ settings
→ plugins
installation: file watchers
plug set according to the following steps:
After installation reboot idea
3.4 Configurationfile watchers
Open
idea
→settings
→tools
→file watchers
;In the opening panel, click on the right plus button to add less configuration, looks like the plug will automatically configure the
After the above steps successfully, edit the file can be automatically compiled into less css file.