2.0.0 • Published 1 month ago

unplugin-detect-duplicated-deps v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

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.config.ts
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/vite';

export default defineConfig({
  plugins: [UnpluginDetectDuplicatedDeps()],
});
// rollup.config.js
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/rollup';

export default {
  plugins: [UnpluginDetectDuplicatedDeps()],
};
// 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

2.0.0

1 month ago

1.1.1

1 month ago

1.0.0

3 months ago

0.4.1

3 months ago

0.4.0

6 months ago

0.3.5

8 months ago

0.3.4

8 months ago

0.3.3

8 months ago

0.3.2

8 months ago

0.3.1

8 months ago

0.3.0

8 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.1

11 months ago