# nodemon-webpack-plugin

> A webpack plugin that starts and reloads a server using Nodemon.

Latest version **4.8.2** (published 2023-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install nodemon-webpack-plugin
pnpm add nodemon-webpack-plugin
yarn add nodemon-webpack-plugin
bun add nodemon-webpack-plugin
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.8.2 |
| Published | 2023-10-10 |
| First published | 2017-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.10.0 |
| Dependencies | 2 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 179 |
| Author | Roey Izhaki |
| Maintainers | roey |
| Keywords | webpack, nodemon, plugin, server, start, watch, restart |

## Links

- npm: https://www.npmjs.com/package/nodemon-webpack-plugin
- Repository: https://github.com/Izhaki/nodemon-webpack-plugin
- Homepage: https://github.com/Izhaki/nodemon-webpack-plugin.git
- Issues: https://github.com/Izhaki/nodemon-webpack-plugin.git/issues
- npm.io page: https://npm.io/package/nodemon-webpack-plugin

## Dependencies (2)

- [nodemon](https://npm.io/package/nodemon.md) 3.0.1
- [@types/nodemon](https://npm.io/package/@types/nodemon.md) latest

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 4.8.2 (latest) — 2023-10-10
- 4.0.3 (next) — 2018-04-11
- 4.8.1 — 2022-07-11
- 4.8.0 — 2022-06-17
- 4.7.1 — 2022-02-03
- 4.7.0 — 2021-11-29
- 4.6.0 — 2021-11-18
- 4.5.2 — 2021-03-26
- 4.5.1 — 2021-03-26
- 4.5.0 — 2021-03-25
- 4.4.4 — 2021-01-13
- 4.4.3 — 2021-01-13
- 4.3.2 — 2020-06-11
- 4.3.1 — 2020-02-17
- 4.2.2 — 2019-12-19
- … 19 more at https://npm.io/package/nodemon-webpack-plugin/versions

## README

# Nodemon Webpack Plugin

<p align="center">
  <img width="100%" src="https://user-images.githubusercontent.com/880132/73990098-0a6ef580-4940-11ea-8df7-c93dda7edb4d.png" />
</p>

<p align="center">
  <a aria-label="Build" href="https://github.com/Izhaki/nodemon-webpack-plugin/actions?query=workflow%3ABuild">
    <img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/Izhaki/nodemon-webpack-plugin/Build">
  </a>
  <a aria-label="NPM version" href="https://npmjs.org/package/nodemon-webpack-plugin">
    <img alt="" src="https://img.shields.io/npm/v/nodemon-webpack-plugin?style=flat-square">
  </a>
  <a aria-label="Downloads" href="https://www.npmjs.com/package/nodemon-webpack-plugin">
    <img alt="" src="https://img.shields.io/npm/dt/nodemon-webpack-plugin?style=flat-square">
  </a>
</p>

Uses [Nodemon](https://nodemon.io/) to watch and restart your module's output file (presumably a server), but only when webpack is in watch mode (ie, `--watch`).

Saves the need for installing, configuring and running Nodemon as a separate process.

## Installation

```bash
npm install nodemon-webpack-plugin --save-dev
```

## Usage

```javascript
const NodemonPlugin = require('nodemon-webpack-plugin'); // Ding

module.exports = {
  entry: './src/server.js',
  output: {
    path: path.resolve('./dist'),
    filename: 'server.js',
  },
  plugins: [
    new NodemonPlugin(), // Dong
  ],
};
```

Then:

```shell
$ webpack --watch
```

## Modes

### Zero-config mode

```javascript
new NodemonPlugin();
```

Will watch and restart the output file.

### With config

Provide a [Nodemon config object](https://github.com/remy/nodemon#config-files), like so:

```javascript
new NodemonPlugin({
  // If using more than one entry, you can specify
  // which output file will be restarted.
  script: './dist/server.js',

  // What to watch.
  watch: path.resolve('./dist'),

  // Arguments to pass to the script being watched.
  args: ['demo'],

  // Node arguments.
  nodeArgs: ['--debug=9222'],

  // Files to ignore.
  ignore: ['*.js.map'],

  // Extensions to watch.
  ext: 'js,njk,json',

  // Unlike the cli option, delay here is in milliseconds (also note that it's a string).
  // Here's 1 second delay:
  delay: '1000',

  // Detailed log.
  verbose: true,

  // Environment variables to pass to the script to be restarted
  env: {
    NODE_ENV: 'development',
  },
});
```

For a full list of options, see Nodemon's [type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/nodemon/index.d.ts) (`Settings` interface).

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