WebStorm how to set automatic file compiled less

First, we need to ensure that the computer installed Node.js , Download: https://nodejs.org/en/

When installing Node.js will automatically install npm

WebStorm how to set automatically compiled HTML file notes less the first one

Then, install module lessc

Open cmd console

Enter the following command line npm install less modules: -g is a global installed, if not installed in the current directory.

npm install less -g

WebStorm how to set automatic compiler less HTML file first two notes

Installation less-plugin-clean-css plug (less plug for compressed code)

npm install less-plugin-clean-css -g

WebStorm how to set automatic compiler less HTML file first three notes

PHPStorm Click File> Settings> Tools> File Watcher add less automatic translation parameters

WebStorm how to set automatic compiler less HTML file first four notes

PhpStrom will automatically recognize lessc.cmd file, if you can not identify, the manual directory to find npm lessc.cmd file can, I am here --clean-css parameters will automatically add the code compression, you can not add, it will not automatically compress code.

WebStorm how to set automatic HTML files compiled less notes of 5

So in the project file when editing less, and always will be automatically generated css files

Results are as follows:

WebStorm how to set automatic compiler less HTML file notes Zhang 6

Guess you like

Origin www.cnblogs.com/zcpblog/p/11346123.html