diff --git a/server/build.go b/server/build.go index f757b8ae4..b5cc4bcb5 100644 --- a/server/build.go +++ b/server/build.go @@ -736,7 +736,10 @@ esbuild: if cjsContext { p = bytes.TrimPrefix(p, []byte{')'}) var marked bool - if _, ok := builtInNodeModules[name]; !ok { + if builtInNodeModules[name] { + cjsImportNames.Add("default") + marked = true + } else { depPkg, _, err := validatePkgPath(name) depWd := task.wd if err == nil && !fileExists(path.Join(depWd, "node_modules", depPkg.Name, "package.json")) { diff --git a/test/issue-566/issue-566.test.ts b/test/issue-566/issue-566.test.ts new file mode 100644 index 000000000..2cd327cb2 --- /dev/null +++ b/test/issue-566/issue-566.test.ts @@ -0,0 +1,7 @@ +import { assertEquals } from "https://deno.land/std@0.178.0/testing/asserts.ts"; + +import { Expo } from "http://localhost:8080/expo-server-sdk@3.7.0"; + +Deno.test("issue #566", () => { + assertEquals(typeof Expo, "function"); +});