sublime text3 install less

1. Install the Sublime plugin
(1) Install the LESS plugin: Because Sublime does not support Less syntax highlighting, install this plugin first. Methods: ctrl+shift+p>install Package>输入less按Enter
(2) Install the LESS2CSS plugin: The function of this plugin is to

When saving the less file, a css file with the same name is automatically generated;
when saving the less file, a compilation error message is prompted;
all the less files in the batch compilation project directory are css files.

installation method:ctrl+shift+p>install Package>输入less2css按Enter

But making sublime support less is not just a matter of installing a sublime plugin. The following steps are also required

2. Install node.js
First configure the environment, less needs nodejs support, so we need to install nodejs first. You can download it from the official website of nodejs: https://nodejs.org/en/
3. Install less
cmd:

cnpm install -g less
安装指定版本less:cnpm install -g less@2.8.1

When building the less file in Sublim later, there will be an error

LESS: Unable to interpret argument clean-css

This is because a
less-plugin-clean-cssplug- . The installation of the plug-in

cnpm install less-plugin-clean-css -g

There will be a problem here: the version of less is 3.0.1 and above, even if the plugin
is installed, the above error will still be reported. In this case, the version of less can be reduced.less-plugin-clean-css

安装指定版本less:cnpm install -g less@2.8.1

Then restart sublime and you're done!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326415378&siteId=291194637