From 98565cc8e693edb6d946402325e7366246d34c24 Mon Sep 17 00:00:00 2001 From: Diego Sisto Date: Mon, 24 Apr 2017 17:50:28 -0300 Subject: [PATCH] delete require cache to read file changes from disk --- lib/consolidate.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/consolidate.js b/lib/consolidate.js index 8a06431..55ec751 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -1312,7 +1312,13 @@ function reactRenderer(type){ if (!cache(options)){ // Parsing - Code = (type === 'path') ? require(resolve(str)) : requireReactString(str); + if (type === 'path') { + var path = resolve(str) + delete require.cache[path] + Code = require(path) + } else { + Code = requireReactString(str) + } Factory = cache(options, react.createFactory(Code)); } else {