# webpack-matching-filefields

> a webpack plugin for matching file&fields

Latest version **1.0.0** (published 2018-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install webpack-matching-filefields
pnpm add webpack-matching-filefields
yarn add webpack-matching-filefields
bun add webpack-matching-filefields
```

## 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.0 |
| Published | 2018-12-18 |
| First published | 2018-12-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jddfe |
| Maintainers | jddfe |
| Keywords | matching, fields |

## Links

- npm: https://www.npmjs.com/package/webpack-matching-filefields
- npm.io page: https://npm.io/package/webpack-matching-filefields

## Recent versions

- 1.0.0 (latest) — 2018-12-18

## README

# webpack-matching-filefields

## 兼容性
- 兼容webpack从0～4的任何版本

## 作用
- 检测指定字符串/正则是否在webpack所打包的模块中

## 传入参数
- 传入单个字符串或正则，若需要判断多个字符/正则，将其作为数组成员放入数组传入
  例如：`['testField',/regField/]` 或 `'testField'` 或 `/regField/` 都可以

## 如何使用
- 在webpack的配置文件中引入： `const MatchingFileFields = require('webpack-matching-filefields')` <-你的插件所在路径
- 在plugins中实例化并传入参数(例如我想检测字符串testField、正则/regField/): `new MatchingFileFields(['testField',/regField/])` <-结果会在执行命令后输出展示在控制台
- 在此附一段简单的webpack配置代码: 
- ```const path = require('path');
const MatchingFileFields = require('webpack-matching-filefields')
module.exports = {
    mode: 'none',
    entry: './main.js',
    output: {
        filename: '[name].js',
        path: path.resolve(__dirname, 'dist')
    },
    plugins: [
        new MatchingFileFields(['testField',/regField/])
    ]}
```

## 显示
- 结果会在执行命令后输出展示在控制台

## 依赖
- 需要在你的项目内安装 colors 模块来显示色彩

---
_Source: https://npm.io/package/webpack-matching-filefields · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
