Permalink
Browse files

page reload works much better with dynamic content now

  • Loading branch information...
1 parent 3112e5d commit 596e49a38afbf9bf5e7ced0593d7b7dfde73fb12 Jeff Escalante committed Mar 1, 2013
Showing with 11 additions and 1 deletion.
  1. +7 −0 lib/commands/watch.js
  2. +3 −0 lib/roots.js
  3. +1 −1 package.json
View
7 lib/commands/watch.js
@@ -4,6 +4,7 @@ var path = require('path'),
_ = require('underscore'),
minimatch = require('minimatch'),
output_path = require('../utils/output_path'),
+ yaml_parser = require('../utils/yaml_parser'),
watcher = require('../watcher'),
roots = require('../roots'),
Compiler = require('../compiler'),
@@ -32,6 +33,12 @@ var _watch = function(){
return roots.compile_project(current_directory, server.reload);
}
+ // if it's a dynamic file, the entire project needs to be recompiled
+ // so that references to it show up in other files
+ if (yaml_parser.detect(file.fullPath)){
+ return roots.compile_project(current_directory, server.reload);
+ }
+
// ignored files that are modified actively are often dependencies
// for another non-ignored file. Until we have something like assetgraph
// in this project, the safest approach is to recompile the whole project
View
3 lib/roots.js
@@ -67,6 +67,9 @@ function analyze(root){
function parse_directory(root){
+ // clear the dynamic locals first
+ global.options.locals.site = null;
+
// format negate pattern
var ignores = [];
global.options.ignore_files.forEach(function(pattern){
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "roots",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "roots is a toolbox for building simple, beautiful, and efficient products for the web",
"keywords": [
"front-end",

0 comments on commit 596e49a

Please sign in to comment.