mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
parent
7f3747f2ef
commit
ae6a2b23ba
4 changed files with 13 additions and 1 deletions
|
@ -552,7 +552,8 @@ impl CliMainWorkerFactory {
|
||||||
.await?;
|
.await?;
|
||||||
self.shared.cjs_resolution_store.is_known_cjs(&main_module)
|
self.shared.cjs_resolution_store.is_known_cjs(&main_module)
|
||||||
} else {
|
} else {
|
||||||
specifier_has_extension(&main_module, "cjs")
|
main_module.scheme() == "file"
|
||||||
|
&& specifier_has_extension(&main_module, "cjs")
|
||||||
};
|
};
|
||||||
(main_module, is_cjs)
|
(main_module, is_cjs)
|
||||||
};
|
};
|
||||||
|
|
5
tests/specs/run/remote_cjs_main/__test__.jsonc
Normal file
5
tests/specs/run/remote_cjs_main/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"args": "run http://localhost:4545/run/add.cjs",
|
||||||
|
"output": "output.out",
|
||||||
|
"exitCode": 1
|
||||||
|
}
|
3
tests/specs/run/remote_cjs_main/output.out
Normal file
3
tests/specs/run/remote_cjs_main/output.out
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Download http://localhost:4545/run/add.cjs
|
||||||
|
error: Expected a JavaScript or TypeScript module, but identified a Cjs module. Importing these types of modules is currently not supported.
|
||||||
|
Specifier: http://localhost:4545/run/add.cjs
|
3
tests/testdata/run/add.cjs
vendored
Normal file
3
tests/testdata/run/add.cjs
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports.add = function (a, b) {
|
||||||
|
return a + b;
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue