diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-01-25 21:13:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-25 21:13:40 +0100 |
| commit | c6c8c91a6e4b7a2b6eed02d3e2f5db25c124d9a0 (patch) | |
| tree | 1fe8e9ab2175154d44e78d153dd760e56dc1c860 /cli/schemas | |
| parent | b5b4887c4a5fefdeb5592ebaadcc941281d0c4d5 (diff) | |
feat: embed import map in the config file (#17478)
This commit changes handling of config file to enable
specifying "imports" and "scopes" objects effectively making
the configuration file an import map.
"imports" and "scopes" take precedence over "importMap" configuration,
but have lower priority than "--importmap" CLI flag.
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/schemas')
| -rw-r--r-- | cli/schemas/config-file.v1.json | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index 675a763a4..f0b496720 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -198,9 +198,31 @@ } }, "importMap": { - "description": "The location of an import map to be used when resolving modules. If an import map is explicitly specified, it will override this value.", + "description": "The location of an import map to be used when resolving modules. If an import map is specified as an `--importmap` flag or using \"imports\" and \"scopes\" properties, they will override this value.", "type": "string" }, + "imports": { + "description": "A map of specifiers to their remapped specifiers.", + "type": "object", + "additionalProperties": { + "description": "The key is the specifier or partial specifier to match, with a value that represents the target specifier.", + "type": "string" + } + }, + "scopes": { + "default": {}, + "description": "Define a scope which remaps a specifier in only a specified scope", + "type": "object", + "properties": {}, + "additionalProperties": { + "description": "A definition of a scoped remapping.", + "type": "object", + "additionalProperties": { + "description": "The key is the specifier or partial specifier to match within the referring scope, with a value that represents the target specifier.", + "type": "string" + } + } + }, "lint": { "description": "Configuration for linter", "type": "object", |
