webpack-dev-middleware
Advanced tools
Comparing version 1.0.11 to 1.1.0
@@ -15,2 +15,10 @@ /* | ||
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 + "$"); | ||
} | ||
} | ||
@@ -63,4 +71,9 @@ // store our files in memory | ||
} | ||
function invalidAsyncPlugin(compiler, callback) { | ||
invalidPlugin(); | ||
callback(); | ||
} | ||
compiler.plugin("invalid", invalidPlugin); | ||
compiler.plugin("compile", invalidPlugin); | ||
compiler.plugin("watch-run", invalidAsyncPlugin); | ||
compiler.plugin("run", invalidAsyncPlugin); | ||
@@ -132,4 +145,5 @@ // the state, false: bundle invalid, true: bundle valid | ||
// in lazy mode, rebuild on bundle request | ||
if(options.lazy && filename === pathJoin(compiler.outputPath, options.filename)) | ||
if(options.lazy && (!options.filename || options.filename.test(filename))) | ||
rebuild(); | ||
// delay the request until we have a vaild bundle | ||
@@ -156,2 +170,3 @@ ready(function() { | ||
res.setHeader("Content-Type", mime.lookup(filename)); | ||
res.setHeader("Content-Length", content.length); | ||
if(options.headers) { | ||
@@ -158,0 +173,0 @@ for(var name in options.headers) { |
{ | ||
"name": "webpack-dev-middleware", | ||
"version": "1.0.11", | ||
"author": "Tobias Koppers @sokra", | ||
"description": "Offers a dev middleware for webpack, which arguments a live bundle to a directory", | ||
"peerDependencies": { | ||
"webpack": "1.x" | ||
}, | ||
"dependencies": { | ||
"enhanced-resolve": "~0.7.5", | ||
"memory-fs": "~0.1.0", | ||
"mime": "1.x" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://www.opensource.org/licenses/mit-license.php" | ||
} | ||
], | ||
"engines": { | ||
"node": ">=0.6" | ||
}, | ||
"homepage": "http://github.com/webpack/webpack-dev-middleware", | ||
"main": "middleware.js", | ||
"repository": { | ||
"type": "git", | ||
"url" : "https://github.com/webpack/webpack-dev-middleware.git" | ||
} | ||
"name": "webpack-dev-middleware", | ||
"version": "1.1.0", | ||
"author": "Tobias Koppers @sokra", | ||
"description": "Offers a dev middleware for webpack, which arguments a live bundle to a directory", | ||
"peerDependencies": { | ||
"webpack": "1.x" | ||
}, | ||
"dependencies": { | ||
"enhanced-resolve": "~0.7.5", | ||
"memory-fs": "~0.1.0", | ||
"mime": "1.x" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://www.opensource.org/licenses/mit-license.php" | ||
} | ||
], | ||
"engines": { | ||
"node": ">=0.6" | ||
}, | ||
"homepage": "http://github.com/webpack/webpack-dev-middleware", | ||
"main": "middleware.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/webpack/webpack-dev-middleware.git" | ||
} | ||
} |
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
7878
169