webpack-hot-middleware
Advanced tools
Comparing version 2.21.1 to 2.21.2
@@ -1,8 +0,9 @@ | ||
exports.pathMatch = pathMatch; | ||
var parse = require('url').parse; | ||
function pathMatch(url, path) { | ||
if (url == path) return true; | ||
var q = url.indexOf('?'); | ||
if (q == -1) return false; | ||
return url.substring(0, q) == path; | ||
exports.pathMatch = function(url, path) { | ||
try { | ||
return parse(url).pathname === path; | ||
} catch (e) { | ||
return false; | ||
} | ||
} |
@@ -16,9 +16,9 @@ module.exports = webpackHotMiddleware; | ||
if (compiler.hooks) { | ||
compiler.hooks.compile.tap("webpack-hot-middleware", onCompile); | ||
compiler.hooks.invalid.tap("webpack-hot-middleware", onInvalid); | ||
compiler.hooks.done.tap("webpack-hot-middleware", onDone); | ||
} else { | ||
compiler.plugin("compile", onCompile); | ||
compiler.plugin("invalid", onInvalid); | ||
compiler.plugin("done", onDone); | ||
} | ||
function onCompile() { | ||
function onInvalid() { | ||
latestStats = null; | ||
@@ -25,0 +25,0 @@ if (opts.log) opts.log("webpack building..."); |
{ | ||
"name": "webpack-hot-middleware", | ||
"version": "2.21.1", | ||
"version": "2.21.2", | ||
"description": "Webpack hot reloading you can attach to your own server", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
584
28049