Closed bvanjoi closed 1 year ago
Sometimes we may need change config after genXxxxConfig, so we may need append a callback after setup .
Could you explain when we need this? The example seems not to be convincing.
First, callback
is used to add or remove certain configuration items to the config generated by Task under the project.
Second, suppose I want to add some configuration items for benchmark tests, there are two options.
I choose option 2, which is the reason for adding callback
.
Got it. The current solution is option1. It makes generating benchmark reports very straightforward and easy to understand. A project with a task.config.js
represents a report.
I tend to not modify Config
generated by task.config.ts
. A task.config.ts
represents a Config
and there shouldn't have any condition to modify it, which means it should be pure.
Sometimes we may need change config after
genXxxxConfig
, so we may need append acallback
aftersetup
.For example, if we want to change speedy config:
task
: https://github.com/speedy-js/benchmarks/compare/main...bvanjoi:callback_for_setupTask?expand=1#diff-55d1354a0b2c73c274b747e6af0d8b7436ffa6595d495dbcb5bb03d0d727622dR109callback
: https://github.com/speedy-js/benchmarks/compare/main...bvanjoi:callback_for_setupTask?expand=1#diff-55d1354a0b2c73c274b747e6af0d8b7436ffa6595d495dbcb5bb03d0d727622dR127