summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-11-16 17:29:35 -0500
committerGitHub <noreply@github.com>2023-11-16 17:29:35 -0500
commitceca097e6f2215fce29f2e6aaca7702fa0a99404 (patch)
treed57c2ea1c9048a3aaa01e9cc787fc0fbfd242cb3 /cli/worker.rs
parentb572abfcb3fadbfdd3ce671a27463d67bcb77534 (diff)
fix(npm): support cjs entrypoint in node_modules folder (#21224)
Closes #21109
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index ed3db5321..8834f59ce 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -495,7 +495,9 @@ impl CliMainWorkerFactory {
}
(node_resolution.into_url(), is_main_cjs)
- } else if shared.options.is_npm_main {
+ } else if shared.options.is_npm_main
+ || shared.node_resolver.in_npm_package(&main_module)
+ {
let node_resolution =
shared.node_resolver.url_to_node_resolution(main_module)?;
let is_main_cjs = matches!(node_resolution, NodeResolution::CommonJs(_));