Skip to content

Commit

Permalink
Merge pull request #277 from suelopoder/master
Browse files Browse the repository at this point in the history
delete require cache to read file changes from disk
  • Loading branch information
doowb committed Sep 18, 2017
2 parents 0b8bee4 + 98565cc commit 81a3ec6
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 @@ -1467,7 +1467,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 81a3ec6

Please sign in to comment.