summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-05-21 17:17:08 +0200
committerSamy Pessé <samypesse@gmail.com>2014-05-21 17:17:08 +0200
commit8d6923ce2cb0d6508a95435afb0cc51045cacaf6 (patch)
tree235edd547d180b55e68a21e290ccee7b5225723b /lib
parent0e1717f4bb979ebdbba5500dd5ae85f7f10f3528 (diff)
parentb21fb24a82577f9caf7fc1db2e1559d128dd798f (diff)
downloadgitbook-8d6923ce2cb0d6508a95435afb0cc51045cacaf6.zip
gitbook-8d6923ce2cb0d6508a95435afb0cc51045cacaf6.tar.gz
gitbook-8d6923ce2cb0d6508a95435afb0cc51045cacaf6.tar.bz2
Merge pull request #234 from davidagraf/livereload
Livereload
Diffstat (limited to 'lib')
-rw-r--r--lib/generate/plugin.js5
-rw-r--r--lib/generate/site/index.js10
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/generate/plugin.js b/lib/generate/plugin.js
index 2b06c15..5804f91 100644
--- a/lib/generate/plugin.js
+++ b/lib/generate/plugin.js
@@ -186,7 +186,8 @@ Plugin.fromList = function(names, root) {
// Default plugins
Plugin.defaults = [
"mixpanel",
- "mathjax"
+ "mathjax",
+ "livereload"
];
-module.exports = Plugin; \ No newline at end of file
+module.exports = Plugin;
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index b63f703..6033fb4 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -237,9 +237,13 @@ Generator.prototype.writeCacheManifest = function() {
};
Generator.prototype.finish = function() {
- return this.copyAssets()
- .then(this.writeSearchIndex)
- .then(this.writeCacheManifest);
+ var deferred = this.copyAssets().then(this.writeSearchIndex);
+
+ if (this.options.cache) {
+ deferred = deferred.then(this.writeCacheManifest);
+ }
+
+ return deferred;
};
module.exports = Generator;