unplugin-unused
Check unused dependencies.
Last updated 4 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install unplugin-unused 
SYNC missed versions from official npm registry.

unplugin-unused

npm version npm downloads Unit Test

Check unused dependencies.

Installation

npm i -D unplugin-unused

Usage

Unused({
  include: [/\.([cm]?[jt]sx?|vue)$/],
  exclude: [/node_modules/],
  level: 'warning', // or 'error'
  /**
   * Ignore some dependencies.
   */
  ignore: {
    peerDependencies: ['vue'],
  },
  // Or ignore all kinds of dependencies.
  // ignore: ['vue'],

  /**
   * Dependency kinds to check.
   */
  depKinds: ['dependencies', 'peerDependencies'],
})
<summary>Vite</summary>
// vite.config.ts
import UnpluginUnused from 'unplugin-unused/vite'

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


<summary>Rollup</summary>
// rollup.config.js
import UnpluginUnused from 'unplugin-unused/rollup'

export default {
  plugins: [UnpluginUnused()],
}


<summary>Rolldown</summary>
// rolldown.config.js
import UnpluginUnused from 'unplugin-unused/rolldown'

export default {
  plugins: [UnpluginUnused()],
}


<summary>esbuild</summary>
// esbuild.config.js
import { build } from 'esbuild'

build({
  plugins: [require('unplugin-unused/esbuild')()],
})


<summary>Webpack</summary>
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [require('unplugin-unused/webpack')()],
}


Sponsors

License

MIT License © 2024-PRESENT Kevin Deng

Current Tags

  • 0.6.0                                ...           latest (4 months ago)

29 Versions

  • 0.6.0                                ...           4 months ago
  • 0.5.7                                ...           10 months ago
  • 0.5.6                                ...           a year ago
  • 0.5.5                                ...           a year ago
  • 0.5.4                                ...           a year ago
  • 0.5.3                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           2 years ago
  • 0.4.4                                ...           2 years ago
  • 0.4.3                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.7                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 66
Today 0
This Week 1
This Month 38
Last Day 0
Last Week 0
Last Month 28
Dependencies (4)
Dev Dependencies (13)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE