From 87f80ff6be5e2a132b583a9c380fff5db3cb2b07 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 20 Aug 2022 11:31:33 -0400 Subject: feat(unstable): initial support for npm specifiers (#15484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/tests/testdata/npm/dynamic_import/main.out | 4 ++++ cli/tests/testdata/npm/dynamic_import/main.ts | 3 +++ cli/tests/testdata/npm/dynamic_import/other.ts | 4 ++++ 3 files changed, 11 insertions(+) create mode 100644 cli/tests/testdata/npm/dynamic_import/main.out create mode 100644 cli/tests/testdata/npm/dynamic_import/main.ts create mode 100644 cli/tests/testdata/npm/dynamic_import/other.ts (limited to 'cli/tests/testdata/npm/dynamic_import') diff --git a/cli/tests/testdata/npm/dynamic_import/main.out b/cli/tests/testdata/npm/dynamic_import/main.out new file mode 100644 index 000000000..3ba847c7e --- /dev/null +++ b/cli/tests/testdata/npm/dynamic_import/main.out @@ -0,0 +1,4 @@ +A +Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz +B +C diff --git a/cli/tests/testdata/npm/dynamic_import/main.ts b/cli/tests/testdata/npm/dynamic_import/main.ts new file mode 100644 index 000000000..8b850a8ee --- /dev/null +++ b/cli/tests/testdata/npm/dynamic_import/main.ts @@ -0,0 +1,3 @@ +const importName = "./other.ts"; +console.log("A"); +await import(importName); diff --git a/cli/tests/testdata/npm/dynamic_import/other.ts b/cli/tests/testdata/npm/dynamic_import/other.ts new file mode 100644 index 000000000..e5d3b6dc3 --- /dev/null +++ b/cli/tests/testdata/npm/dynamic_import/other.ts @@ -0,0 +1,4 @@ +console.log("B"); +const chalk = (await import("npm:chalk@5")).default; + +console.log(chalk.green("C")); -- cgit v1.2.3