From e7d7da85dff177bbc919cab48643135c68e065bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 6 Nov 2022 00:58:21 +0100 Subject: fix(npm): fix CJS resolution with local node_modules dir (#16547) This commit fixes CJS resolution when there's a local "node_modules/" directory. Before this commit relative imports from CJS files where resolved relative to root directory of the package instead of relative to referrer file. --- cli/tests/integration/npm_tests.rs | 8 ++++++++ 1 file changed, 8 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 72af72a76..5dae2fd1c 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -641,6 +641,14 @@ itest!(node_modules_dir_with_deps { temp_cwd: true, }); +itest!(node_modules_dir_yargs { + args: "run --allow-read --allow-env --unstable --node-modules-dir $TESTDATA/npm/cjs_yargs/main.js", + output: "npm/cjs_yargs/main.out", + envs: env_vars(), + http_server: true, + temp_cwd: true, +}); + #[test] fn node_modules_dir_cache() { let _server = http_server(); -- cgit v1.2.3