相关信息:
Windows10
Webstorm2016.2.4
Nodejs4.6.1
描述
安装less,并且自动产生.css和.css.map文件
安装过程:
打开命令行
打开cmd,输入“cd C:\Program Files\nodejs”,回车,进入nodejs目录,输入npm install less -g,回车
打开webstorm的设置
设置external tool
tools - external tool - 点击“+”
Tool settings,下面的地址可以直接复制并粘贴到自己设置里,然后把用户名“a”改成自己的
Programs,C:\Program Files\nodejs\node.exe
Paramenters,C:\Users\a\AppData\Roaming\npm\node_modules\less\bin\lessc$FilePath$ $FileDir$\$FileNameWithoutExtension$.css
设置filewatchers
添加一个watcher,watcher settings
program,C:\Users\a\AppData\Roaming\npm\lessc.cmd
arguments,--no-color--source-map=$FileNameWithoutExtension$.css.map $FileName$
Outputpaths to refresh
$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map
新建一个less文件,就会自动生成.css和.map