Jake: javascript 里的 make 工具
一个前端圈里的,任务管理工具
大纲
- 安装
- 配置文件
- 快速开始
- 基本
api
安装
# 全局安装
yarn global add jake
npm install --location=global jake
# 安装到项目中
yarn add -D jake
配置文件
优先识别: Jakefile, Jakefile.js, jakefile, or jakefile.js
快速开始
# 创建配置文件,文件内容如下
touch Jakefile
# 列出所有task
jake -T
# 执行默认
jake
# 执行 otherTask
jake otherTask
let { task, desc } = require('jake');
desc('This is the default task.');
task('default', function () {
console.log('This is the default task.');
console.log('Jake will run this task if you run `jake` with no task specified.');
});
desc('This is some other task. It depends on the default task');
task('otherTask', ['default'], function () {
console.log('Some other task');
});
基本api
-f / --jakefile FILE | Use FILE as the Jakefile. |
---|---|
-C / --directory DIRECTORY | Change to DIRECTORY before running tasks. |
-q / --quiet | Do not log built-in Jake messages to standard output. |
-B / --always-make | Unconditionally make all targets. |
-t / -T / -ls / --tasks [PATTERN] | Display the tasks (matching optional PATTERN) with descriptions, then exit. |
-J / --jakelibdir JAKELIBDIR | Auto-import any .jake files in JAKELIBDIR (default is 'jakelib'). |
-h / --help | Display this help message. |
-V / -v / --version | Display the Jake version. |