Skip to content

Commit

Permalink
delete require cache to read file changes from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Sisto committed Apr 24, 2017
1 parent 894b0de commit 98565cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 98565cc

Please sign in to comment.