From 3b028195c1389c166cffdbf99d52aa16b3979c25 Mon Sep 17 00:00:00 2001 From: gxz Date: Fri, 6 Dec 2024 15:38:28 +0800 Subject: [PATCH] feat: add global args --- README.md | 4 ++++ terra/src/base/terra_configs.ts | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index d04a8d4..921aeb1 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,10 @@ renderers: args: config1: true config2: 'xyz' + +# List of global args +globalArgs: + type: 'rtc' ``` ### Custom `Parser` and `Renderer` diff --git a/terra/src/base/terra_configs.ts b/terra/src/base/terra_configs.ts index 8f732f4..6587645 100644 --- a/terra/src/base/terra_configs.ts +++ b/terra/src/base/terra_configs.ts @@ -65,6 +65,13 @@ export class TerraConfigs { }); let renderers = (parsedYaml.renderers ?? []).map((p: any) => { + p.args = + parsedYaml.globalArgs || p.args + ? { + ...parsedYaml.globalArgs, + ...p.args, + } + : undefined; return p as TerraLoaderConfig; });