UNPKG

1.44 kBMarkdownView Raw
1# start-server-webpack-plugin
2
3> Automatically start your server once Webpack's build completes.
4
5[![travis build](https://img.shields.io/travis/ericclemmons/start-server-webpack-plugin.svg)](https://travis-ci.org/ericclemmons/start-server-webpack-plugin)
6[![version](https://img.shields.io/npm/v/start-server-webpack-plugin.svg)](http://npm.im/estart-server-webpack-plugin)
7[![downloads](https://img.shields.io/npm/dm/start-server-webpack-plugin.svg)](http://npm-stat.com/charts.html?package=start-server-webpack-plugin)
8[![MIT License](https://img.shields.io/npm/l/start-server-webpack-plugin.svg)](http://opensource.org/licenses/MIT)
9
10### Installation
11
12```shell
13$ npm install --save-dev start-server-webpack-plugin
14```
15
16### Usage
17
18In `webpack.config.server.babel.js`:
19
20```js
21import StartServerPlugin from "start-server-webpack-plugin";
22
23export default {
24 // This script will be ran after building
25 entry: {
26 server: ...
27 },
28 ...
29 plugins: [
30 ...
31 // Only use this in DEVELOPMENT
32 new StartServerPlugin('server.js'),
33 ...
34 ],
35 ...
36}
37```
38
39The `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.
40
41If you don't pass a name, the plugin will tell you the available names.
42
43### License
44
45> MIT License 2016 © Eric Clemmons