Socket
Socket
Sign inDemoInstall

webpack-dev-middleware

Package Overview
Dependencies
32
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.1 to 0.8.2

30

middleware.js

@@ -27,2 +27,5 @@ /*

// We need a cache to cache also in lazy mode
wpOpt.cache = wpOpt.cache || new (require("webpack/lib/Cache"))();
// Grap files from webpack

@@ -65,2 +68,8 @@ wpOpt.emitFile = function(filename, content) {

});
// In lazy mode, we may issue another rebuild
if(forceRebuild) {
forceRebuild = false;
rebuild();
}
});

@@ -83,2 +92,11 @@

function rebuild() {
if(state) {
state = false;
webpack.apply(null, args);
} else {
forceRebuild = true;
}
}
// store our files in memory

@@ -90,2 +108,5 @@ var files = {};

// in lazy mode, rebuild automatically
var forceRebuild = false;
// delayed callback

@@ -111,6 +132,9 @@ var callbacks = [];

if(req.url.indexOf(localPrefix) != 0) return next();
// else delay the request until we have a vaild bundle
// get filename from request
var filename = req.url.substr(localPrefix.length);
// in lazy mode, rebuild on bundle request
if(filename === wpOpt.output && !wpOpt.watch)
rebuild();
// delay the request until we have a vaild bundle
ready(function() {
// get filename from request
var filename = req.url.substr(localPrefix.length);
// check if it is a generated file

@@ -117,0 +141,0 @@ if(!(filename in files)) return next();

2

package.json
{
"name": "webpack-dev-middleware",
"version": "0.8.1",
"version": "0.8.2",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "Offers a dev middleware for webpack, which arguments a live bundle to a directory",

@@ -52,2 +52,4 @@ # webpack-dev-middleware

// This is not required, but recommendated to get the best out of the middleware.
// If you pass false, the middleware switch to lazy mode, which means rebundling
// every request. A cache is automatically attached in lazy mode.

@@ -54,0 +56,0 @@ publicPrefix: "http://localhost:8080/assets/",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc