From 4f15aada02450824a0a6e2602dde2fffdd9fd90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 11 Jul 2024 17:43:28 +0100 Subject: fix(workspace): allow using --import-map flag with workspace (#24527) This is a temporary fix, which is not perfect - specifying `--import-map` will break resolution of packages defined in `workspace` setting, but erroring on `--import-map` currently causes regression in code that worked fine in v1.44.x. --- tests/specs/run/workspaces/explicit_import_map/__test__.jsonc | 5 +++++ tests/specs/run/workspaces/explicit_import_map/import_map.json | 5 +++++ tests/specs/run/workspaces/explicit_import_map/main.out | 2 ++ tests/specs/run/workspaces/explicit_import_map/main.ts | 3 +++ tests/specs/run/workspaces/explicit_import_map/package.json | 3 +++ 5 files changed, 18 insertions(+) create mode 100644 tests/specs/run/workspaces/explicit_import_map/__test__.jsonc create mode 100644 tests/specs/run/workspaces/explicit_import_map/import_map.json create mode 100644 tests/specs/run/workspaces/explicit_import_map/main.out create mode 100644 tests/specs/run/workspaces/explicit_import_map/main.ts create mode 100644 tests/specs/run/workspaces/explicit_import_map/package.json (limited to 'tests') diff --git a/tests/specs/run/workspaces/explicit_import_map/__test__.jsonc b/tests/specs/run/workspaces/explicit_import_map/__test__.jsonc new file mode 100644 index 000000000..2bd0d3bcc --- /dev/null +++ b/tests/specs/run/workspaces/explicit_import_map/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A --import-map=./import_map.json main.ts", + "output": "main.out", + "tempDir": true +} diff --git a/tests/specs/run/workspaces/explicit_import_map/import_map.json b/tests/specs/run/workspaces/explicit_import_map/import_map.json new file mode 100644 index 000000000..a2827b171 --- /dev/null +++ b/tests/specs/run/workspaces/explicit_import_map/import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "chalk": "npm:chalk" + } +} diff --git a/tests/specs/run/workspaces/explicit_import_map/main.out b/tests/specs/run/workspaces/explicit_import_map/main.out new file mode 100644 index 000000000..c420c1853 --- /dev/null +++ b/tests/specs/run/workspaces/explicit_import_map/main.out @@ -0,0 +1,2 @@ +[WILDCARD] +hello diff --git a/tests/specs/run/workspaces/explicit_import_map/main.ts b/tests/specs/run/workspaces/explicit_import_map/main.ts new file mode 100644 index 000000000..56dcea678 --- /dev/null +++ b/tests/specs/run/workspaces/explicit_import_map/main.ts @@ -0,0 +1,3 @@ +import chalk from "chalk"; + +console.log(chalk.green("hello")); diff --git a/tests/specs/run/workspaces/explicit_import_map/package.json b/tests/specs/run/workspaces/explicit_import_map/package.json new file mode 100644 index 000000000..e5e2f6f5d --- /dev/null +++ b/tests/specs/run/workspaces/explicit_import_map/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["packages/*"] +} -- cgit v1.2.3