Find whether there are unused assets in the project
Configuration Option Name | Required | Meaning | Default Value | Type |
---|---|---|---|---|
path |
No | The resource path to search | ./src | string |
output |
No | The output file path | ./unused-files.json | string |
exclude |
No | The file types to exclude | [] | string[] |
npm install unused-assets-webpack-plugin -D
// or
pnpm add unused-assets-webpack-plugin -D
- vue.config.js
const UnusedAssetsWebpackPlugin = require('unused-assets-webpack-plugin')
module.exports = {
configureWebpack: {
plugins: [new UnusedAssetsWebpackPlugin()]
}
}