Bundling a Node server usually should not inline dependencies: it makes the output enormous, breaks packages with native addons, and defeats the runtime's own caching. Marking each dependency external by hand with repeated --external: flags is tedious and drifts from package.json.
esbuild 0.18 added --packages=external, which treats every bare import specifier as external in one flag while still bundling relative imports of your own source. This is the right default for a server build where node_modules will be installed alongside the output.
Two caveats. Relative imports are unaffected, so a dependency reached through a relative path into node_modules is still inlined. And externals must actually be present at runtime, which means the production install cannot use --omit=dev if a bundled entry point imports something declared as a dev dependency. For a library, --packages=external plus peerDependencies is the usual pairing so consumers deduplicate shared packages themselves.