From 2f651b2d64523bdd377d22b8b7213a04ad82f459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 2 May 2023 02:35:33 +0200 Subject: fix(npm): canonicalize filename before returning (#18948) This commit changes how paths for npm packages are handled, by canonicalizing them when resolving. This is done so that instead of returning "node_modules/@/node_modules//index.js" (which is a symlink) we "node_modules/@/index.js. Fixes https://github.com/denoland/deno/issues/18924 Fixes https://github.com/bluwy/create-vite-extra/issues/31 --------- Co-authored-by: David Sherret --- cli/tests/integration/npm_tests.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cli/tests/integration/npm_tests.rs') diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index 8f6ac7528..d4f2d3e45 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -156,6 +156,16 @@ itest!(mixed_case_package_name_local_dir { temp_cwd: true, }); +itest!(local_dir_resolves_symlinks { + args: "run -A index.js", + output: "npm/local_dir_resolves_symlinks/index.out", + exit_code: 0, + envs: env_vars_for_npm_tests(), + cwd: Some("npm/local_dir_resolves_symlinks/"), + copy_temp_dir: Some("npm/local_dir_resolves_symlinks/"), + http_server: true, +}); + // FIXME(bartlomieju): npm: specifiers are not handled in dynamic imports // at the moment // itest!(dynamic_import { -- cgit v1.2.3