Skip to content

Commit 81a3ec6

Browse files
authored
Merge pull request #277 from suelopoder/master
delete require cache to read file changes from disk
2 parents 0b8bee4 + 98565cc commit 81a3ec6

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
@@ -1467,7 +1467,13 @@ function reactRenderer(type){
14671467

14681468
if (!cache(options)){
14691469
// Parsing
1470-
Code = (type === 'path') ? require(resolve(str)) : requireReactString(str);
1470+
if (type === 'path') {
1471+
var path = resolve(str)
1472+
delete require.cache[path]
1473+
Code = require(path)
1474+
} else {
1475+
Code = requireReactString(str)
1476+
}
14711477
Factory = cache(options, react.createFactory(Code));
14721478

14731479
} else {

0 commit comments

Comments
 (0)