Webstorm build less environment and set compressed CSS

Source: Internet
Author: User

Webstorm with less, but to compile the words need NODEJS environment. First go to Node's home page to download the corresponding version of Nodejs and then install, download address: http://nodejs.org/After installation, open a command prompt (win+r), enter node-v and Npm-v if the return version number indicates that you installed successfully. Next you can install less, command prompt NPM enters NPM Manager, then NPM install less starts downloading less, the default installation directory is in user name \node_modules. Here less installed, then configure Webstorm. Open Webstorm's file->settings->external Tools, click the "Plus" sign add in the upper left corner to enter the dialog box
Program is set in the path of LESSC, where the directory can refer to the screenshot in the red box in the directory, he will be compiled to the root directory default. For example:/USERS/XX/NODE_MODULES/LESS/BIN/LESSC If you want to conveniently compress the compiled CSS, in addition to writing in arguments--plugin= LESS-PLUGIN-CLEAN-CSS also install the compression plugin: sudo npm install-g less-plugin-clean-css, here to pay attention to my installation path, If the last Less-plugin-clean-css path and the top of the/users/xx/node_modules/less not a path then also run up, so how to solve it, You can directly copy the Less-plugin-clean-css folder in the Clean-css path to/users/xx/node_modules/.
Then you can specify a shortcut key for this compiler, I use ALT + B to open a. Less suffix name file, shortcut key compilation, if Webstorm bottom state controller shows Process finished with exit code 0, then congratulations, Done.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.