connect-livereload
Advanced tools
Comparing version 0.5.4 to 0.6.0
@@ -23,6 +23,9 @@ module.exports = function livereload(opt) { | ||
var port = opt.port || 35729; | ||
var plugins = opt.plugins || []; | ||
function snippet(host) { | ||
var src = opt.src || '//' + host + ':' + port + '/livereload.js?snipver=1'; | ||
return '<script src="' + src + '" async="" defer=""></script>'; | ||
return [src].concat(plugins).map(function(source) { | ||
return '<script src="' + source + '" async="" defer=""></script>'; | ||
}).join(''); | ||
} | ||
@@ -156,3 +159,3 @@ | ||
// Also, some implementations call "end" directly with all data. | ||
res.inject(string); | ||
res.inject(string, encoding); | ||
runPatches = false; | ||
@@ -159,0 +162,0 @@ // Check if our body is HTML, and if it does not already have the snippet. |
{ | ||
"name": "connect-livereload", | ||
"description": "connect middleware for adding the livereload script to the response", | ||
"version": "0.5.4", | ||
"version": "0.6.0", | ||
"author": "Andi Neck <andi.neck@intesso.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -98,2 +98,10 @@ | ||
disableCompression: false, | ||
// Locations where livereload plugins are provided (not by connect-livereload). | ||
// These plugins should handle being loaded before _or_ after the livereload | ||
// script itself (the order is not guaranteed), like | ||
// https://github.com/mixmaxhq/livereload-require-js-includes/blob/5a431793d6fdfcf93d66814ddc58338515a3254f/index.js#L40-L45 | ||
plugins: [ | ||
"http://localhost:3001/livereload-require-js-includes/index.js" | ||
] | ||
``` | ||
@@ -100,0 +108,0 @@ |
Sorry, the diff of this file is not supported yet
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
12895
144
164