# multiple-js-entry-plugin

> 动态载入 js 入口文件

Latest version **0.0.2** (published 2020-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install multiple-js-entry-plugin
pnpm add multiple-js-entry-plugin
yarn add multiple-js-entry-plugin
bun add multiple-js-entry-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-07-08 |
| First published | 2020-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 2 |
| Unpacked size | 433.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pyrine.Law |
| Maintainers | pyrinelaw |
| Keywords | multiple-js-entry-plugin, webpack, webpack-plugin, multiple-js, multiple-js-entry, js-entry-plugin |

## Links

- npm: https://www.npmjs.com/package/multiple-js-entry-plugin
- Repository: https://github.com/pyrinelaw/multiple-js-entry-plugin
- Homepage: https://github.com/pyrinelaw/multiple-js-entry-plugin#readme
- Issues: https://github.com/pyrinelaw/multiple-js-entry-plugin/issues
- npm.io page: https://npm.io/package/multiple-js-entry-plugin

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^7.1.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-07-08
- 0.0.1 — 2020-07-08

## README

## multiple-js-entry-plugin

webpack 插件，动态载入 js 入口文件，webpack >= 4.0.0

### 使用示例

```javascript
const MultipleJsEntryPlugin = require('../../plugin/index.js');

new MultipleJsEntryPlugin({
    src: path.join(__dirname, '../src'),
    split: '-',
    level: 0,
    // 入口匹配 js 文件
    // entryFiles: '*/**/index.js',
    // 过滤条件
    // filter: (file) => {
    //     return true;
    // },
    // 文件路径 entry 格式化转化
    // 需要返回 entry name
    // format: (file) => {
    //     return entryName
    // },
})
```

### 参数说明

参数     | 类型 | 是否必传 | 默认值 | 说明
-------- | --- | --- | --- | ---
src | String | 是 | undefined | 动态匹配路径文件夹路径
split | String | 否 | ”-“ | 转换间隔，例如路径 a/b/c 转换为 a-b-c
level | Number | 否 | 0 | 匹配目录层级，0表示所有层级
entryFiles | String | 否 | */**/index.js | 动态匹配 js 规则
filter | Function | 否 | null | 根据文件路径地址过滤规则方法
format | Function | 否 | null | 根据文件路径地址动态格式化 entry name 方法

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