npm.io
1.0.1 • Published 8 years ago

webpack-node-server-plugin

Licence
MIT
Version
1.0.1
Deps
1
Size
22 kB
Vulns
0
Weekly
0
Stars
3

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.

Keywords