工作流简化之Gulp

2017-07-22  本文已影响11人  卖梦想的男孩

gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.

gulp是一个任务自动化的工具集,旨在帮助开发者们处理复杂耗时的编译、处理工作。

安装

npm install gulp-cli -g
npm install gulp -D
touch gulpfile.js
gulp --help

角色定义

gulp主要有几个角色

使用指南

gulp的任务系统定义在guplfile.js中,也可以在运行时通过--gupfile 来指定任务文件,一般约定默认。

var watcher = gulp.watch('xxxx',['task1','task2']);
watcher.on('event_type', function(event) {
  //do what you need when event_type happend
});

or

gulp.watch('xxxx', function(event) {
  //do what you need when all event type happend
});

官网 http://gulpjs.com
API https://github.com/gulpjs/gulp/blob/master/docs/API.md

上一篇 下一篇

猜你喜欢

热点阅读