https://github.com/blaugold/webpack-node-server-plugin
https://github.com/blaugold/webpack-node-server-plugin
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/blaugold/webpack-node-server-plugin
- Owner: blaugold
- Created: 2016-11-12T02:29:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T19:46:16.000Z (about 8 years ago)
- Last Synced: 2024-10-19T09:17:56.877Z (over 1 year ago)
- Language: TypeScript
- Size: 162 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## Webpack Node Server Plugin
Webpack plugin which restarts node script with every compilation.
## Install
```bash
npm i -D webpack-node-server-plugin
```
## Usage
Import the plugin trough `import` syntax:
```javascript
import { NodeServerPlugin } from 'webpack-node-server-plugin'
```
Or through `require`:
```javascript
const NodeServerPlugin = require('webpack-node-server-plugin').NodeServerPlugin;
```
And add it to your webpack config:
```javascript
module.exports = {
target: 'node',
entry: './server.js',
output: {
path: '.tmp/dev',
filename: '[name].bundle.js'
},
resolve: {
extensions: ['.js']
},
plugins: [
new NodeServerPlugin()
]
}
```
Per default the first `entry` with the extension `.js` is used when starting the server.
## Config
Look at [`NodeServerPluginConfig`](src/config.ts) for config options.