Node.js
sudo apt-get install nodejs
node --version [查看node版本]
Nmp
sudo apt-get install npm
Grunt
安装 npm和bower:
$ sudo npm -g install grunt-cli bower
更新:npm install grunt --save-dev
安装dependencies:
$cd 想要执行grunt的目录/
$npm install
$bower install
运行Grunt:
- build and compress:
$ grunt
- watch and build (no compress) :
$ grunt watch
- optimize images:
$ grunt imagemin
用grunt 有什么好处?
--------------------
正常工作的时候grunt watch会运行
自动编译与合并less, 自动检测js错误, 合并js
代码提交git之前运行grunt build 或者 grunt ,会压缩js和css
另外的好处是 live reload.保存less 或者js文件时自动刷新你的浏览器
Gulp
- 安装全局gulp环境 : $ npm install --global gulp
- 安装gulp插件,gulp插件所属devDependencies下面 : $ npm install --save-dev gulp
- npm install & bower install
- gulp
网友评论