Skip to content

Commit 98565cc

Browse files
author
Diego Sisto
committed
delete require cache to read file changes from disk
1 parent 894b0de commit 98565cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/consolidate.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,13 @@ function reactRenderer(type){
13121312

13131313
if (!cache(options)){
13141314
// Parsing
1315-
Code = (type === 'path') ? require(resolve(str)) : requireReactString(str);
1315+
if (type === 'path') {
1316+
var path = resolve(str)
1317+
delete require.cache[path]
1318+
Code = require(path)
1319+
} else {
1320+
Code = requireReactString(str)
1321+
}
13161322
Factory = cache(options, react.createFactory(Code));
13171323

13181324
} else {

0 commit comments

Comments
 (0)