Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-node-externals

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-node-externals

ESBuild plugin for node externals.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc