Skip to content

cpeddecord/restify-webpack-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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,
  }
);

About

Webpack Dev/Hot Middleware wrapper for use with Restify

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published