# useless-files-webpack5-plugin

> useless-files-webpack-plugin 兼容webpack5版本

Latest version **1.0.2** (published 2023-05-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install useless-files-webpack5-plugin
pnpm add useless-files-webpack5-plugin
yarn add useless-files-webpack5-plugin
bun add useless-files-webpack5-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-05-18 |
| First published | 2023-05-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hhd |
| Maintainers | hhd15147218548 |
| Keywords | useless, files, webpack, webpack5, plugin, useless-files-webpack-plugin, useless-files-webpack5-plugin, 代码减重 |

## Links

- npm: https://www.npmjs.com/package/useless-files-webpack5-plugin
- npm.io page: https://npm.io/package/useless-files-webpack5-plugin

## Dependencies (1)

- [shelljs](https://npm.io/package/shelljs.md) ^0.8.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-05-18
- 1.0.1 — 2023-05-18

## README

# useless-files-webpack5-plugin 

## 使用说明
- 因为 useless-files-webpack-plugin 插件不支持 webpack5，所以该版本兼容了 webpack5 以及5之前的版本
- 使用时需新增参数 webpack: '5' , 标记是webpack5项目

## 使用方法
### 安装依赖
```shell
npm i useless-files-webpack5-plugin -S
```

### webpack配置
- 注意： 如果是webpack5的项目，需要新增参数webpack: '5', 非webpack5可以不加这个参数
```ts
    const UselessFile = require('useless-files-webpack5-plugin')

plugins: [
    new UselessFile({
        webpack: '5', // 如果是webpack5的项目，需要说明webpack版本为 5 ，其他webpack版本无需这个参数
        root: path.resolve(__dirname, './src'), // 项目目录
        out: './fileList.json', // 输出文件列表名
        clean: false, // 是否自动删除文件, 谨慎使用
        exclude: /node_modules/ // 排除文件列表
    })
]
```

### vue项目 配置
- 注意： 如果是webpack5的项目，需要新增参数webpack: '5', 非webpack5可以不加这个参数
```ts
    const UselessFile = require('useless-files-webpack5-plugin')

    configureWebpack: config => {
        config.plugins.push(
            new UselessFile({
                webpack: '5', // 如果是webpack5的项目，需要说明webpack版本为 5 ，其他webpack版本无需这个参数
                root: path.resolve(__dirname, './src'), // 项目目录
                out: './fileList.json', // 输出文件列表名
                clean: false, // 是否自动删除文件, 谨慎使用
                exclude: /node_modules/ // 排除文件列表
            })
        )
    }
```

---
_Source: https://npm.io/package/useless-files-webpack5-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
