Skip to content

Commit

Permalink
fix: clean require cache before loading file content (#405)
Browse files Browse the repository at this point in the history
fixes issue #404
  • Loading branch information
Okazari authored Apr 17, 2020
1 parent 16c3040 commit 18a50d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/utils/combineJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function combineJSON(arr, deep, collision) {
var file_content;

try {
// This delete force require(resolvedPath) to take the latest version of the file. It's handfull when using the node package along chokidar.
delete require.cache[resolvedPath]
file_content = require(resolvedPath);
} catch (e) {
e.message = 'Failed to load or parse JSON or JS Object: ' + e.message;
Expand Down

0 comments on commit 18a50d0

Please sign in to comment.