webpack-node-server-plugin
v1.0.1
Published
Webpack plugin which restarts node script with every compilation.
Downloads
177
Maintainers
Readme
Webpack Node Server Plugin
Webpack plugin which restarts node script with every compilation.
Install
npm i -D webpack-node-server-plugin
Usage
Import the plugin trough import
syntax:
import { NodeServerPlugin } from 'webpack-node-server-plugin'
Or through require
:
const NodeServerPlugin = require('webpack-node-server-plugin').NodeServerPlugin;
And add it to your webpack config:
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
for config options.