unplugin-detect-duplicated-deps
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

unplugin-detect-duplicated-deps

npm downloads Unit Test

Detect duplicate packaged dependencies

effect

Installation

npm i -D unplugin-detect-duplicated-deps

Usage

You can use the jsdoc to check option description and default value.

Vite
// vite.config.ts
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/vite';

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

Rollup
// rollup.config.js
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/rollup';

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

Webpack
// webpack.config.mjs
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/webpack';

const config = {
  plugins: [UnpluginDetectDuplicatedDeps()],
};

Use as build checker

export default defineConfig({
  plugins: [
    UnpluginDetectDuplicatedDeps({
      // will exit build process if duplicated deps found
      throwErrorWhenDuplicated: true,
      // ignore specific duplicated deps
      ignore: {
        axios: ['0.27.2'],
        vue: ['*'],
      },
    }),
  ],
});

Use in commonjs environment

Because vite6 plan to deprecate commonjs node api, this plugin deprecate the commonjs support from 1.x. If you want use this plugin in commonjs environment, check 0.x

Thanks

Recommend Readings

License

MIT License © 2023-PRESENT YuTengjing

/unplugin-detect-duplicated-deps/

    Package Sidebar

    Install

    npm i unplugin-detect-duplicated-deps

    Weekly Downloads

    1,447

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    24.4 kB

    Total Files

    19

    Last publish

    Collaborators

    • yutengjing