0.0.10 • Published 11 months ago

unplugin-externalize-deps v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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.config.ts
import UnpluginExternalizeDeps from 'unplugin-externalize-deps/vite';

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

// 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

0.0.10

11 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago