Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update livereload.js

  • Loading branch information...
commit e3fc728afb97a463aaeb5ccbe3ca4b56009a3d8b 1 parent c9d0fca
@andreyvit andreyvit authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 dist/livereload.js
View
11 dist/livereload.js
@@ -784,7 +784,8 @@ __livereload.LiveReload = LiveReload = (function() {
this.log("LiveReload received reload request for " + message.path + ".");
return this.reloader.reload(message.path, {
liveCSS: (_ref = message.liveCSS) != null ? _ref : true,
- liveImg: (_ref2 = message.liveImg) != null ? _ref2 : true
+ liveImg: (_ref2 = message.liveImg) != null ? _ref2 : true,
+ originalPath: message.originalPath || ''
});
};
LiveReload.prototype.performAlert = function(message) {
@@ -809,12 +810,14 @@ __livereload.LiveReload = LiveReload = (function() {
_livereload: this,
_reloader: this.reloader,
_connector: this.connector,
+ console: this.console,
Timer: Timer,
generateCacheBustUrl: function(url) {
return this.reloader.generateCacheBustUrl(url);
}
});
this.plugins.push(plugin);
+ this.reloader.addPlugin(plugin);
};
LiveReload.prototype.analyze = function() {
var plugin, pluginData, pluginsData, _i, _len, _ref;
@@ -847,9 +850,13 @@ __less = LessPlugin = (function() {
this.host = host;
}
LessPlugin.prototype.reload = function(path, options) {
- if (path.match(/\.less$/i) && this.window.less && this.window.less.refresh) {
+ console.log([path, options]);
+ if ((path.match(/\.less$/i) || options.originalPath.match(/\.less$/i)) && this.window.less && this.window.less.refresh) {
+ this.host.console.log("LiveReload is asking LESS to recompile all stylesheets");
this.window.less.refresh(true);
+ return true;
}
+ return false;
};
LessPlugin.prototype.analyze = function() {
return {
Please sign in to comment.
Something went wrong with that request. Please try again.