# dev-on-demand-webpack-plugin

> dev on demand with webpack

Latest version **0.1.2** (published 2020-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install dev-on-demand-webpack-plugin
pnpm add dev-on-demand-webpack-plugin
yarn add dev-on-demand-webpack-plugin
bun add dev-on-demand-webpack-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.1.2 |
| Published | 2020-09-11 |
| First published | 2020-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | qgr@winbaoxian.com |
| Maintainers | qiuguodong88 |
| Keywords | dev, on-demand, as-needed, webpack, plugin |

## Links

- npm: https://www.npmjs.com/package/dev-on-demand-webpack-plugin
- Repository: https://github.com/qiuguorong/dev-on-demand-webpack-plugin
- Issues: https://github.com/qiuguorong/dev-on-demand-webpack-plugin/issues
- npm.io page: https://npm.io/package/dev-on-demand-webpack-plugin

## Dependencies (1)

- [yargs](https://npm.io/package/yargs.md) ^15.4.1

## 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.1.2 (latest) — 2020-09-11
- 0.1.1 — 2020-09-10
- 0.1.0 — 2020-09-10

## README

# dev-on-demand-webpack-plugin

webpack多入口按需构建插件，可在多入口时指定页面运行，提升开发阶段编译速度

# 安装

```shell
npm install dev-on-demand-webpack-plugin --save-dev
```

# 使用

webpack.config.js配置

```js
const DevOnDemand = require('dev-on-demand-webpack-plugin')
module.exports = {
  plugins: {
    new DevOnDemand()
  },
}
```

命令行运行，其中一个

```shell
npm run dev -p=keyword
npm run dev --page=keyword
npm run dev -- -p=keyword
npm run dev -- --page=keyword
npm run dev keyword
npm run dev -p=keyword1,keyword2
```

# 参数

## defaultKeywords

类型：`Array` 默认值：`[]`

默认关键字数组，用于多页面必须启动的页面

webpack.config.js配置
```js
module.exports = {
  plugins: {
    new DevOnDemand({
      defaultKeywords: ['index', 'login']
    })
  },
}
```

## separator
类型: `String` 默认值：`,`

关键字分隔符

webpack.config.js配置
```js
module.exports = {
  plugins: {
    new DevOnDemand({
      separator: '|'
    })
  },
}
```

运行命令行
```shell
npm run dev -p=keyword1|keyword2
```

## command

类型：`Object` 默认值：`{ key: 'page', alias: 'p' }`

CLI命令行参数与别名

webpack.config.js配置
```js
module.exports = {
  plugins: {
    new DevOnDemand({
      command: {
        key: 'options',
        alias: 'o'
      }
    })
  },
}
```

运行命令行
```shell
npm run dev -o=keyword
npm run dev --options=keyword
```

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