From f1d3a170430501b4fab1a2d2abb5d77528251c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 5 Oct 2021 01:35:55 +0200 Subject: feat: add --compat flag to provide built-in Node modules (#12293) This commit adds "--compat" flag. When the flag is passed a set of mappings for built-in Node modules is injected into the import map. If user doesn't explicitly provide an import map (using "--import-map" flag) then a map is created on the fly. If there are already existing mappings in import map that would clash with built-in Node modules a set of diagnostics is printed to the terminal with suggestions how to proceed. --- cli/tests/testdata/compat/existing_import_map.out | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cli/tests/testdata/compat/existing_import_map.out (limited to 'cli/tests/testdata/compat/existing_import_map.out') diff --git a/cli/tests/testdata/compat/existing_import_map.out b/cli/tests/testdata/compat/existing_import_map.out new file mode 100644 index 000000000..0e319b115 --- /dev/null +++ b/cli/tests/testdata/compat/existing_import_map.out @@ -0,0 +1,5 @@ +[WILDCARD] +Some Node built-ins were not added to the import map: + - "fs/promises" already exists and is mapped to "[WILDCARD]non_existent_file.js" +If you want to use Node built-ins provided by Deno remove listed specifiers from "imports" mapping in the import map file. +error: Cannot resolve module [WILDCARD] \ No newline at end of file -- cgit v1.2.3