ITADN

Extend a common configuration

#1292Openfilimon-danopoulos 创建于 2025-03-07
In monorepo scenarios it is common to have repeating task. For example running TSC in a design system mono repo. It would be beneficial to be able to extend a common configuration in such scenario. I would like to suggest an extension API to either extend an entire configuration or single script. To extend an entire config one could do: ```json { scripts: { build: 'wireit' }, wireit: { extends: '../config/wireit.json' } } ``` To extend individual scripts one would do: ```json { scripts: { build: 'wireit' }, wireit: { build: { extends: '../config/wireit.json:build' } } } ``` Note the use of `:build` similar to the syntax in dependencies. Wireit would add the file as dependency and merge the configuration in such a way that the local config has precedence. It was noted in Discord that the collision of `extends` at the top level of the wireit config have to be handled. I suggest a very simplistic approach where if extends is a string it is handled as an extension otherwise as a script.
0 条评论