diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-05-23 12:49:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 12:49:28 -0400 |
commit | d93b7627f0451355027d4fc0f2dd1c63c58ecc3d (patch) | |
tree | 7141b243b19234d8d5c222ed430b32e0a48f4641 /cli/tools/vendor/build.rs | |
parent | b65d5024ef5e61301a6c8c4380bc20f4949ac60d (diff) |
fix(vendor): handle relative imports when mapped local folder name differs from remote's (#14465)
Diffstat (limited to 'cli/tools/vendor/build.rs')
-rw-r--r-- | cli/tools/vendor/build.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cli/tools/vendor/build.rs b/cli/tools/vendor/build.rs index 0e42edb4a..dd362ebfb 100644 --- a/cli/tools/vendor/build.rs +++ b/cli/tools/vendor/build.rs @@ -628,10 +628,14 @@ mod test { .add("/mod.ts", "import 'https://localhost/mod.ts';") .add( "https://localhost/mod.ts", - "import './npm:test@1.0.0/test/test!cjs';", + "import './npm:test@1.0.0/test/test!cjs?test';import './npm:test@1.0.0/mod.ts';", + ) + .add( + "https://localhost/npm:test@1.0.0/mod.ts", + "console.log(4);", ) .add_with_headers( - "https://localhost/npm:test@1.0.0/test/test!cjs", + "https://localhost/npm:test@1.0.0/test/test!cjs?test", "console.log(5);", &[("content-type", "application/javascript")], ); @@ -648,7 +652,9 @@ mod test { }, "scopes": { "./localhost/": { - "./localhost/npm:test@1.0.0/test/test!cjs": "./localhost/npm_test@1.0.0/test/test!cjs.js" + "./localhost/npm:test@1.0.0/mod.ts": "./localhost/npm_test@1.0.0/mod.ts", + "./localhost/npm:test@1.0.0/test/test!cjs?test": "./localhost/npm_test@1.0.0/test/test!cjs.js", + "./localhost/npm_test@1.0.0/test/test!cjs?test": "./localhost/npm_test@1.0.0/test/test!cjs.js" } } })) @@ -658,8 +664,9 @@ mod test { to_file_vec(&[ ( "/vendor/localhost/mod.ts", - "import './npm:test@1.0.0/test/test!cjs';" + "import './npm:test@1.0.0/test/test!cjs?test';import './npm:test@1.0.0/mod.ts';" ), + ("/vendor/localhost/npm_test@1.0.0/mod.ts", "console.log(4);"), ( "/vendor/localhost/npm_test@1.0.0/test/test!cjs.js", "console.log(5);" |