Pure ESM library builds #3069
maxholman
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently switched one of our pure ESM javascript libraries to Bazel.
As a pure ESM lib with a top level package.json of
type: "module"
, therules_nodejs
code which is targeting commonjs throws anERR_REQUIRE_ESM
error during builds.I came up with a patch (love this feature btw) that introduces a package.json into the
rules_nodejs
source tree so that it avoids consuming my own.Here's the patch:
I am way out of my depth when it comes to Bazel, so I thought it best to avoid going for a PR and post a discussion instead. I'm sure I have missed some edge cases which I am not currently using.
If the above is useful/correct I'd be happy to contribute!
Beta Was this translation helpful? Give feedback.
All reactions