Skip to content

Commit

Permalink
Merge pull request #105 from sparklinm/dev-before-done-hook
Browse files Browse the repository at this point in the history
feat(cli): add beforeDone hook
  • Loading branch information
Genuifx authored Feb 16, 2021
2 parents c65eede + da396d5 commit 8a9684c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/wxa-cli/src/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Builder {
entryOption: new SyncBailHook(['entry']),
beforeRun: new AsyncSeriesHook(['compiler']),
run: new AsyncSeriesHook(['compiler']),
beforeDone: new AsyncSeriesHook(['compilation']),
done: new AsyncParallelHook(['compilation']),
rebuildModule: new AsyncSeriesHook(['changedModule']),
finishRebuildModule: new AsyncParallelHook(['compilation', 'changedModule']),
Expand Down Expand Up @@ -279,6 +280,9 @@ class Builder {
this.scheduler.perf.show();

try {
// beforeDone.
await this.hooks.beforeDone.promise(this.scheduler);

debug('schedule dependencies Tree is %O', this.scheduler.$indexOfModule);
await this.optimizeAndGenerate(this.scheduler.$indexOfModule, this.scheduler.appConfigs, cmd);

Expand Down

0 comments on commit 8a9684c

Please sign in to comment.