mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
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.
This commit is contained in:
parent
384e53308a
commit
e7d7da85df
4 changed files with 91 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue