-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
Description
Current Behavior
After migrating from 22.2.3 to 22.2.4, the bundle produced by @nx/esbuild plugin now includes 3rd party libraries into the bundle, in my case rxjs. This behavior can be mitigated by explicitly setting targets.build.options.external to ["rxjs"].
Expected Behavior
By default, I expect the bundle not to include 3rd party libraries without the need to list them explicitly in the plugin's options.
GitHub Repo
https://github.com/granito-source/vitest-marbles/tree/v1.0.2
Steps to Reproduce
- Execute
nx migrate 22.2.4in the repo. - Run
nx run-many -t build. - Inspect the produced
dist/vitest-marbles/index.jsto see that it inlinesrxjslibrary. - Set
nx.targets.build.options.externalto["rxjs"]inpackage.json. - Run
nx run-many -t build --skip-nx-cache. - Inspect the produced
dist/vitest-marbles/index.jsto see that it no longer inlines the library.
Nx Report
Node : 24.12.0
OS : darwin-arm64
Native Target : aarch64-macos
npm : 11.6.2
nx (global) : 22.3.3
nx : 22.2.4
@nx/js : 22.2.4
@nx/workspace : 22.2.4
@nx/devkit : 22.2.4
@nx/esbuild : 22.2.4
@nx/vitest : 22.2.4
typescript : 5.9.3
---------------------------------------
Registered Plugins:
@nx/vitest
---------------------------------------
Cache Usage: 0.00 B / 92.64 GBFailure Logs
Package Manager Version
No response
Operating System
- macOS
- Linux
- Windows
- Other (Please specify)
Additional Information
The same issue exists in 22.2.7 and in 22.3.3.