Permalink
Browse files

Fixed Less file compiling

  • Loading branch information...
1 parent 302e83b commit 8eb83ec2afad28f3e3bd8b56d49fabb142665c91 @buger committed Mar 12, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 Cakefile
View
@@ -115,7 +115,8 @@ compile = (file, ext) ->
when 'coffee'
exec "coffee -c #{file}"
when 'less'
- exec 'lessc #{file}'
+ css = file.replace(".less", ".css")
+ exec "lessc #{file} > #{css}"
task "compile", "Compile all files", (options) ->
@@ -142,9 +143,12 @@ task 'watch', 'watch and compile coffee, less and tmpl files', ->
walk __dirname, (err, files) ->
for file in files
((file) ->
- if ext = file.match(/\.(tmpl|coffee|less)$/)?[1]
- fs.watch file, (event) -> compile file, ext
-
+ if ext = file.match(/\.(tmpl|coffee|less)$/)?[1]
+ compileFunc = _.throttle ->
+ compile file, ext
+ , 100
+
+ fs.watch file, compileFunc
)(file)

0 comments on commit 8eb83ec

Please sign in to comment.