Bundling with esbuild

If you're bundling your Node.js app with esbuild, it's necessary to mark the packages to instrument as external.

For example, if you are running an application with Mongoose and you want to send instrumentation data to AppSignal, you must flag the Mongoose dependency as external in your build script command as in the example below:

javascript
// package.json { //... "build:appsignal": "esbuild src/appsignal.ts --bundle --platform=node --external:mongoose --external:@appsignal/nodejs", //... }