Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Less.js plugin actually works now; originalPath support added

  • Loading branch information...
commit c9d0fca416ac548537c2dc40272b9fa5d52aa299 1 parent ba25d6e
@andreyvit andreyvit authored
Showing with 8 additions and 2 deletions.
  1. +5 −2 src/less.coffee
  2. +3 −0  src/livereload.coffee
View
7 src/less.coffee
@@ -6,9 +6,12 @@ module.exports = class LessPlugin
constructor: (@window, @host) ->
reload: (path, options) ->
- if path.match(/\.less$/i) and @window.less and @window.less.refresh
+ console.log [path, options]
+ if (path.match(/\.less$/i) || options.originalPath.match(/\.less$/i)) and @window.less and @window.less.refresh
+ @host.console.log "LiveReload is asking LESS to recompile all stylesheets"
@window.less.refresh(true)
- return
+ return true
+ false
analyze: ->
{ disable: !!(@window.less and @window.less.refresh) }
View
3  src/livereload.coffee
@@ -79,6 +79,7 @@ exports.LiveReload = class LiveReload
@reloader.reload message.path,
liveCSS: message.liveCSS ? yes
liveImg: message.liveImg ? yes
+ originalPath: message.originalPath || ''
performAlert: (message) ->
alert message.message
@@ -103,6 +104,7 @@ exports.LiveReload = class LiveReload
_connector: @connector
# official API
+ console: @console
Timer: Timer
generateCacheBustUrl: (url) -> @reloader.generateCacheBustUrl(url)
@@ -126,6 +128,7 @@ exports.LiveReload = class LiveReload
# compilation of a matching plugin's files)
@plugins.push plugin
+ @reloader.addPlugin plugin
return
analyze: ->
Please sign in to comment.
Something went wrong with that request. Please try again.