🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

restify-webpack-middleware

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify-webpack-middleware

Webpack Dev/Hot Middleware wrapper for use with Restify

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
1
Created
Source

Restify Webpack Middleware

Just a thin wrapper around Webpack Dev Middleware and Webpack Hot Middleware for use with Restify.

registerWebpackMiddleware()

registerWebpackMiddleware(restifyInstance, { compiler, webpackDevConfig, webpackHotConfig });

Pass the instance of your Restify server along with the compiled Webpack config and the standard configuration objects from both Dev and Hot Middlewares and presto/chango/whamo you'll have some hot-dev middleware action.

import restify from 'restify';
import webpack from 'webpack';
import registerWebpackMiddleware from 'restify-webpack-middleware';

import webpackConfig from './path/to/your/webpack.config';

const server = restify.createServer({ ... });

const compiler = webpack(webpackConfig);

const webpackDevConfig = {
  webpackConfig,
  publicPath: webpackConfig.output.publicPath,
};

const webpackHotConfig = {
  log: console.log,
  path: '/__webpack_hmr',
};

registerWebpackMiddleware(
  restifyApp,
  {
    compiler,
    webpackDevConfig,
    webpackHotConfig,
  }
);

Keywords

webpack

FAQs

Package last updated on 16 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts