From c6c8c91a6e4b7a2b6eed02d3e2f5db25c124d9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 25 Jan 2023 21:13:40 +0100 Subject: 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 Co-authored-by: David Sherret --- cli/schemas/config-file.v1.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'cli/schemas') 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", -- cgit v1.2.3