New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unplugin-externalize-deps

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin-externalize-deps

externalize dependencies from production build

  • 0.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

unplugin-externalize-deps

NPM version Test

externalize dependencies from production build

📦 Installation

# npm
npm i unplugin-externalize-deps

# pnpm
pnpm i unplugin-externalize-deps
Vite
// vite.config.ts
import UnpluginExternalizeDeps from 'unplugin-externalize-deps/vite';

export default defineConfig({
  plugins: [UnpluginExternalizeDeps()],
});


Rollup
// rollup.config.js
import UnpluginExternalizeDeps from 'unplugin-externalize-deps/rollup';

export default {
  plugins: [UnpluginExternalizeDeps()],
};


⚙️ Options

export interface Options {
  /** any first level field in package.json */
  depTypes?: {
    /** @default true */
    dependencies: boolean;
    /** @default false */
    devDependencies: boolean;
    /** @default true */
    optionalDependencies: boolean;
    /** @default true */
    peerDependencies: boolean;
    [key: string]: boolean;
  };
  /**
   * whether externalize node builtin modules like: fs, path
   *
   * Note: this will also externalize node builtin modules with `node:` protocol, like: node:fs, node:path
   *
   * @default false
   */
  nodeBuiltins?: boolean;
  /**
   * the path(s) to your package.json, or similar json config file, for example: importmap config
   *
   * @default path.resolve(process.cwd(), 'package.json')
   */
  packagePath?: string | string[];
  /**
   * specify a list of deps which must bundled, a dependency will not excluded if matched
   *
   * @example ['axios', /lodash(-es)?/]
   * @default []
   */
  bundleDeps?: Array<string | RegExp>;
}

❤️ Thanks

Keywords

FAQs

Package last updated on 01 Jun 2023

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