Will mark all npm packages as "external", except the ones passed to this plugin. Kinda like Vite's noExternal
option.
npm i -D esbuild-plugin-noexternal
import esbuild from 'esbuild';
import externalizeAllPackagesExcept from 'esbuild-plugin-noexternal';
esbuild.build({
// ...
bundle: true,
plugins: [externalizeAllPackagesExcept(['nanoid', 'slash' /*...*/])],
});