@jsenv/core 41.3.0 → 41.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,16 @@ export const jsenvPluginWorkspaceBundle = ({ packageDirectory }) => {
41
41
  // root package, we don't want to bundle
42
42
  return null;
43
43
  }
44
+ if (reference.type !== "js_import") {
45
+ // Only consolidate ES imports of a workspace package into its single
46
+ // bundle. Other reference kinds are their own entry points — most
47
+ // importantly an HTML <script src> pointing at a package file (jsenv
48
+ // injects its own client scripts that way: server events, the client
49
+ // monitoring reporter, custom-elements-redefine…). Redirecting those to
50
+ // the package main would run the wrong module, and for @jsenv/core the
51
+ // main is node-only code (node:url) that cannot be served to a browser.
52
+ return null;
53
+ }
44
54
  // we make sure we target the bundle version of the package
45
55
  // otherwise we might execute some parts of the package code multiple times.
46
56
  // so we need to redirect the potential reference to non entry point to the package main entry point