unplugin-unused
Check unused dependencies.
Installation
npm i -D unplugin-unused
Usage
Unused({
include: [/\.([cm]?[jt]sx?|vue)$/],
exclude: [/node_modules/],
level: 'warning',
ignore: {
peerDependencies: ['vue'],
},
depKinds: ['dependencies', 'peerDependencies'],
})
Vite
import UnpluginUnused from 'unplugin-unused/vite'
export default defineConfig({
plugins: [UnpluginUnused()],
})
Rollup
import UnpluginUnused from 'unplugin-unused/rollup'
export default {
plugins: [UnpluginUnused()],
}
Rolldown
import UnpluginUnused from 'unplugin-unused/rolldown'
export default {
plugins: [UnpluginUnused()],
}
esbuild
import { build } from 'esbuild'
build({
plugins: [require('unplugin-unused/esbuild')()],
})
Webpack
module.exports = {
plugins: [require('unplugin-unused/webpack')()],
}
License
MIT License © 2024-PRESENT 三咲智子