1.0.3 • Published 6 years ago

webpack-dev-hot-middleware v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

webpack-dev-hot-middleware

Reload webpack configuration in your express application

Example usage

  const express = require("express")
  const path = require("path")
  const app = express();
  const hmrWebpack = require("webpack-dev-hot-middleware")
  // absolute webpack path file
  const webpackFile = path.join(__dirname, "..", "webpack.config.js");
  const { middleware, emitter } = hmrWebpack(webpackFile, config => ({
      publicPath: config.output.publicPath
  }));
  // Will be fired when webpack config is malformed
  emitter.on("error", (err) => {
      console.log("Webpack error", err);
  })
  
  // Will be fired when webpack is successful reloaded
  emitter.on("reload", () => {
      console.log("Successful reloaded");
  })
  app.use(middleware);
  app.listen(3000);
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago