使用 CoffeeScript 来编写 gulpfile
习惯使用 CoffeeScript 之后,都不怎么想写 Javascript 了,于是在新的项目当中我就试着使用去写 gulpfile,在网上查阅了一下,发现还是挺简单的。
安装 coffee-script
npm install coffee-script --save-dev
编写 gulpfile.js
在 gulpfile.js 中写这两行:
require('coffee-script/register');
require('./gulpfile.coffee');
现在,你就可以新建一个 gulpfile.coffee
来用 CoffeeScript 来编写 gulpfile 了!