Skip to content

Commit

Permalink
[Optimize] 优化文档,补充 params 的说明
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualSJ committed Apr 27, 2024
1 parent c953ee5 commit e013644
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ import { initWorkflow, executeTask } from '@itharbors/workflow';
// 初始化工作流
initWorkflow({
entry: '.build.config.js',
params: argv,
params: {
argv: process.argv,
test: 'a',
},
cache: join(__dirname, '../../.temp/.cache-build.json'),
cacheDir: join(__dirname, '../../.temp'),
workspaces: [
Expand Down Expand Up @@ -100,18 +103,20 @@ for (const taskName in results) {
文件里的配置格式,请看 source/internal 内各个任务的定义

```js
exports.remove = function() {
// params 是 initWorkflow 时传入的那个 params
// 主要用于项目内控制部分流程,比如构建的时候只构建脚本、只构建样式等功能
exports.remove = function(params) {
return ['./dist'];
};
exports.npm = function() {
exports.npm = function(params) {
return [{
message: '安装依赖',
path: './',
params: ['install'],
detail: '依赖安装失败,请检查网络和配置',
}];
};
exports.tsc = function() {
exports.tsc = function(params) {
return ['./'];
};
```
Expand Down

0 comments on commit e013644

Please sign in to comment.