Socket
Socket
Sign inDemoInstall

esbuild-plugin-node-externals

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-node-externals

ESBuild plugin for node externals.


Version published
Weekly downloads
1.1K
decreased by-3.15%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

esbuild-plugin-node-externals

ESBuild plugin for node externals handing.

  • Author
  • GitHub Repo
  • Changelog

Usage

npm install esbuild-plugin-node-externals --save-dev
pnpm install esbuild-plugin-node-externals --save-dev
yarn add esbuild-plugin-node-externals --save-dev
import { build } from 'esbuild';
import { nodeExternals } from 'esbuild-plugin-node-externals';

(async () => {
  const res = await build({
    entryPoints: ['.src/main.ts'],
    bundle: true,
    outfile: './dist/main.js',
    plugins: [
      nodeExternals({
        packagePaths: 'package.json',
        include: ['SOME_PKG_YOU_WANT_TO_INCLUDE_AT_BUNDLE'],
      }),
    ],
  });
})();

Configurations

export interface NodeExternalsOptions {
  /**
   * list of package.json paths to read from
   * if not specified, will read from cwd
   */
  packagePaths: string | string[];

  /**
   * mark all dependencies as external
   * @default true
   */
  withDeps: boolean;

  /**
   * mark all devDependencies as external
   * @default true
   */
  withDevDeps: boolean;

  /**
   * mark all peerDependencies as external
   * @default true
   */
  withPeerDeps: boolean;

  /**
   * mark all optionalDependencies as external
   * @default true
   */
  withOptDeps: boolean;

  /**
   * list of packages to exclude from externalization
   */
  include: string[];
}

Keywords

FAQs

Last updated on 21 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc