Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-dev-middleware

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-dev-middleware - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

27

middleware.js

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

*/
var path = require("path");
var MemoryFileSystem = require("memory-fs");

@@ -15,10 +16,2 @@ var mime = require("mime");

if(!options.stats.context) options.stats.context = process.cwd();
if(options.lazy) {
if(typeof options.filename === "string") {
var str = options.filename
.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")
.replace(/\\\[[a-z]+\\\]/ig, ".+");
options.filename = new RegExp("^" + str + "$");
}
}

@@ -119,4 +112,4 @@ // store our files in memory

if(url.indexOf(localPrefix) !== 0) {
if(/^https?:\/\//.test(localPrefix)) {
localPrefix = "/" + localPrefix.replace(/^https?:\/\/[^\/]+\//, "");
if(/^(https?:)?\/\//.test(localPrefix)) {
localPrefix = "/" + localPrefix.replace(/^(https?:)?\/\/[^\/]+\//, "");
// fast exit if another directory requested

@@ -138,5 +131,5 @@ if(url.indexOf(localPrefix) !== 0) return false;

if (filename === false) return next();
// in lazy mode, rebuild on bundle request
if(options.lazy && (!options.filename || options.filename.test(filename)))
if(options.lazy && filename === pathJoin(compiler.outputPath, options.filename))
rebuild();

@@ -147,3 +140,11 @@ // delay the request until we have a vaild bundle

var stat = fs.statSync(filename);
if(!stat.isFile()) throw "next";
if(!stat.isFile()) {
if (stat.isDirectory()) {
filename = path.join(filename, "index.html");
stat = fs.statSync(filename);
if(!stat.isFile()) throw "next";
} else {
throw "next";
}
}
} catch(e) {

@@ -150,0 +151,0 @@ return next();

{
"name": "webpack-dev-middleware",
"version": "1.0.10",
"version": "1.0.11",
"author": "Tobias Koppers @sokra",

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc