From b34e751a5b2193e8ce65203386e00147c08a7a64 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 15 Feb 2023 11:30:54 -0500 Subject: refactor: make resolver required (#17783) Makes the resolver required and prints a warning when vendoring and a dynamic import can't be resolved. Closes #16522 --- cli/tests/testdata/vendor/dynamic_non_existent.ts | 11 +++++++++++ cli/tests/testdata/vendor/dynamic_non_existent.ts.out | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 cli/tests/testdata/vendor/dynamic_non_existent.ts create mode 100644 cli/tests/testdata/vendor/dynamic_non_existent.ts.out (limited to 'cli/tests/testdata/vendor') diff --git a/cli/tests/testdata/vendor/dynamic_non_existent.ts b/cli/tests/testdata/vendor/dynamic_non_existent.ts new file mode 100644 index 000000000..a48e2accb --- /dev/null +++ b/cli/tests/testdata/vendor/dynamic_non_existent.ts @@ -0,0 +1,11 @@ +// this should still vendor +// deno-lint-ignore no-constant-condition +if (false) { + await import("./non-existent.js"); +} + +export class Logger { + log(text: string) { + console.log(text); + } +} diff --git a/cli/tests/testdata/vendor/dynamic_non_existent.ts.out b/cli/tests/testdata/vendor/dynamic_non_existent.ts.out new file mode 100644 index 000000000..a1b2ade81 --- /dev/null +++ b/cli/tests/testdata/vendor/dynamic_non_existent.ts.out @@ -0,0 +1,7 @@ +Download http://localhost:4545/vendor/dynamic_non_existent.ts +Download http://localhost:4545/vendor/non-existent.js +Ignoring: Dynamic import not found "http://localhost:4545/vendor/non-existent.js". + at http://localhost:4545/vendor/dynamic_non_existent.ts:4:16 +Vendored 1 module into vendor/ directory. + +To use vendored modules, specify the `--import-map vendor/import_map.json` flag when invoking Deno subcommands or add an `"importMap": ""` entry to a deno.json file. -- cgit v1.2.3