Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liaoyinglong/webpack-plugin-deps-analyzer
https://github.com/liaoyinglong/webpack-plugin-deps-analyzer
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/liaoyinglong/webpack-plugin-deps-analyzer
- Owner: liaoyinglong
- Created: 2024-03-25T14:40:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-08T07:12:15.000Z (9 months ago)
- Last Synced: 2024-08-09T10:41:50.278Z (5 months ago)
- Language: TypeScript
- Size: 273 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webpack-plugin-deps-analyzer
用于做依赖项的整理优化
## feature
- 收集所有参与编译的文件
- 查看参与编译的依赖版本
- 查找多个版本的依赖
- 查看依赖参与编译的文件个数## usage
```js
import DepsAnalyzer from "webpack-plugin-deps-analyzer";const webpackConfig = {
plugins: [
new DepsAnalyzer({
outDir: output,
verbose: true,
}),
],
};
```## 配置项
```ts
export interface Options {
/**
* json 文件输出路径
*/
outDir?: string;
/**
* 是否打印日志
* @default true
*/
verbose?: boolean;
}
```## 输出 json 文件示例
```json
{
"deps": {
"@adraffy/ens-normalize": ["1.10.1"],
"@coinbase/wallet-sdk": ["3.9.1"],
"@lit/reactive-element": ["1.6.3", "2.0.4"]
},
"files": {
"@adraffy/[email protected]": [
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@adraffy/ens-normalize/dist/index.mjs"
],
"@coinbase/[email protected]": [
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@coinbase/wallet-sdk/dist/assets/wallet-logo.js",
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@coinbase/wallet-sdk/dist/CoinbaseWalletSDK.js",
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@coinbase/wallet-sdk/dist/core/constants.js",
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@coinbase/wallet-sdk/dist/core/error/constants.js",
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@coinbase/wallet-sdk/dist/core/error/errors.js",
"/projectRoot/node_modules/.pnpm/@[email protected]/node_modules/@coinbase/wallet-sdk/dist/core/error/index.js"
]
},
"issuer": {
"@adraffy/[email protected]": "/projectRoot/node_modules/.pnpm/[email protected]/node_modules/ethers/lib.esm/hash/namehash.js",
"@coinbase/[email protected]": "/projectRoot/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@web3modal/ethers/dist/esm/src/utils/defaultConfig.js",
"@lit/[email protected]": "/projectRoot/node_modules/.pnpm/[email protected]/node_modules/lit/index.js",
"@lit/[email protected]": "/projectRoot/node_modules/.pnpm/[email protected]/node_modules/lit/index.js"
}
}
```## 打印 log 示例
![example](./assets/image.png)