esbuild-plugin-node-externals
ESBuild plugin for node externals handing.
Usage
GitHub Repository/Homepage is private for now, if you got any troubles, just open issue in this repo.
npm i esbuild-plugin-node-externals -D
pnpm i esbuild-plugin-node-externals -D
yarn add esbuild-plugin-node-externals -D
import { build } from 'esbuild';
import { esbuildPluginNodeExternals } from 'esbuild-plugin-node-externals';
(async () => {
const res1 = await build({
entryPoints: ['apps/nest-app/index.ts'],
bundle: true,
outfile: './dist/main.js',
plugins: [
esbuildPluginNodeExternals({
packagePaths: 'apps/nest-app/package.json',
include: ['SOME_PKG_YOU_WANT_TO_INCLUDE_AT_BUNDLE'],
}),
],
});
})();
Configuration
export interface Options {
packagePaths?: string | string[];
withDeps?: boolean;
withDevDeps?: boolean;
withPeerDeps?: boolean;
withOptDeps?: boolean;
include?: string[];
}