Automatically add shared libs to an application's output with esbuild and ESM #30476
PieterJanVdb
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently when using esbuild to build a node app using the following options:
format: ["cjs"]
bundle: false
it'll take a look at any shared libs being used and make their build output is placed in the application's output folder:
nx/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts
Line 75 in 3d710ce
So you end up with the following output:

However for ESM it just disregards this altogether. Is there a reason as to why this is done and can anyone recommend any workarounds to have a similar end result as with CJS, preferably without bundling everything.
Beta Was this translation helpful? Give feedback.
All reactions