-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esbuild: graceful continue when bundling dead code (#3215)
- previously, when encountering a dead code path that requires a not-installed instrumented package, build would fail - this would happen when, say, `knex` requires the `tedious` library for an app that is only making use of `pg` - without `dd-trace/esbuild`, a user simply adds `tedious` to their `external` list and goes on with their day - or in other words, vanilla esbuild doesn't really care when it encounters these missing modules - with `dd-trace/esbuild`, we would throw an error and the build fails - one solution would be to not instrument external packages but many users expect this behavior to work - in fact, we've been telling users to do just this before we supported a plugin - now, with this change, the `require('unused-module')` call remains in the output code - print a warning when this happens (at build time), regardless of debug level, since it might not be intentional
- Loading branch information
Showing
6 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters