Commits

John Wright  committed c99d7a8

Only refreshing the page once the concated js file has been updated.

  • Participants
  • Parent commits 938a723

Comments (0)

Files changed (2)

File package.json

     "frontfax": "bin/frontfax.js"
   },
   "scripts": {
-    "prepublish": "coffee -b -c -o build src"
+    "prepublish": "coffee -b -c -o build src",
+	"dev": "coffee -b -c -w -o build src"
   },
   "author": "John Wright <john.wright@fairfaxmedia.com.au>",
   "dependencies": {

File src/app/controllers/socket.coffee

 path   = require 'path'
 gaze   = require 'gaze'
 socket = require '../../lib/socket'
+config = require 'config'
 
 exports.refreshServer = (server)->
 	ioServer = io.listen server, 'log level': 2
 	ioServer.sockets.on 'connection', (socket)->
 
-		gaze '**/*.css', (err, watcher)->
+		gaze 'assets/css/**/*.css', (err, watcher)->
 			unless err
 				@on 'all', (event, filename)->
 					console.log 'Refreshing your CSS'
 					socket.emit 'refreshCSS'
 
-		gaze ['assets/**/*.js', 'static/**/*.*', 'images/**.*'], (err, watcher)->
+		jsFile = config.concat.files.dest ? 'assets/**/*.js'
+
+		gaze [jsFile, 'static/**/*.*', 'images/**.*'], (err, watcher)->
 			unless err
 				@on 'all', (event, filename)->
 					console.log 'Refreshing your page'