# start-server-webpack-plugin

> Automatically start your server once Webpack's build completes.

Latest version **2.2.5** (published 2018-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install start-server-webpack-plugin
pnpm add start-server-webpack-plugin
yarn add start-server-webpack-plugin
bun add start-server-webpack-plugin
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.5 |
| Published | 2018-03-07 |
| First published | 2016-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/start-server-webpack-plugin) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 157 |
| Author | Eric Clemmons |
| Maintainers | ericclemmons, wmertens |
| Keywords | webpack, server, start, watch, restart, express |

## Links

- npm: https://www.npmjs.com/package/start-server-webpack-plugin
- Repository: https://github.com/ericclemmons/start-server-webpack-plugin
- Homepage: https://github.com/ericclemmons/start-server-webpack-plugin#readme
- Issues: https://github.com/ericclemmons/start-server-webpack-plugin/issues
- npm.io page: https://npm.io/package/start-server-webpack-plugin

## 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

- 2.2.5 (latest) — 2018-03-07
- 3.0.0-rc3 (beta) — 2018-03-16
- 3.0.0-rc2 — 2018-03-15
- 3.0.0-rc1 — 2018-03-08
- 2.2.4 — 2018-03-07
- 2.2.3 — 2018-03-04
- 2.2.2 — 2018-03-04
- 2.2.1 — 2018-02-03
- 2.2.0 — 2017-04-10
- 2.1.2 — 2017-02-27
- 2.1.1 — 2016-10-27
- 2.1.0 — 2016-10-27
- 2.0.2 — 2016-10-27
- 2.0.1 — 2016-06-05
- 2.0.0 — 2016-04-11

## README

# start-server-webpack-plugin

> Automatically start your server once Webpack's build completes.

[![travis build](https://img.shields.io/travis/ericclemmons/start-server-webpack-plugin.svg)](https://travis-ci.org/ericclemmons/start-server-webpack-plugin)
[![version](https://img.shields.io/npm/v/start-server-webpack-plugin.svg)](http://npm.im/start-server-webpack-plugin)
[![downloads](https://img.shields.io/npm/dm/start-server-webpack-plugin.svg)](http://npm-stat.com/charts.html?package=start-server-webpack-plugin)
[![MIT License](https://img.shields.io/npm/l/start-server-webpack-plugin.svg)](http://opensource.org/licenses/MIT)

### Installation

```shell
$ npm install --save-dev start-server-webpack-plugin
```

### Usage

In `webpack.config.server.babel.js`:

```js
import StartServerPlugin from "start-server-webpack-plugin";

export default {
  // This script will be ran after building
  entry: {
    server: ...
  },
  ...
  plugins: [
    ...
    // Only use this in DEVELOPMENT
    new StartServerPlugin({
      name: 'server.js',
      nodeArgs: ['--inspect'], // allow debugging
      args: ['scriptArgument1', 'scriptArgument2'], // pass args to script
      signal: false | true | 'SIGUSR2', // signal to send for HMR (defaults to `false`, uses 'SIGUSR2' if `true`)
      keyboard: true | false, // Allow typing 'rs' to restart the server. default: only if NODE_ENV is 'development'
    }),
    ...
  ],
  ...
}
```

The `name` argument in `new StartServerPlugin(name)` refers to the built asset, which is named by the output options of webpack (in the example the entry `server` becomes `server.js`. This way, the plugin knows which entry to start in case there are several.

If you don't pass a name, the plugin will tell you the available names.

You can use `nodeArgs` and `args` to pass arguments to node and your script, respectively. For example, you can use this to use the node debugger.

To use Hot Module Reloading with your server code, set Webpack to "hot" mode and include the `webpack/hot/poll` or `webpack/hot/signal` modules. Make sure they are part of your server bundle, e.g. if you are using `node-externals` put them in your whitelist. The latter module requires the `signal` option.

### License

> MIT License 2016 © Eric Clemmons

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