Skip to content

Commit

Permalink
Merge pull request #16 from JoelBesada/fix-watch
Browse files Browse the repository at this point in the history
Make sure the latest uncached translation file is read when using --watch
  • Loading branch information
christineoo authored Jun 16, 2020
2 parents 0361d55 + 34fe540 commit 1ea7cfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const getTranslationFromModel = (
}
const extname = path.extname(filePath);
if (isJson(extname) || isSource(extname)) {
delete require.cache[require.resolve(filePath)];
return require(filePath) as JsonObject;
}
return Error('file extension type should be either .json or .ts|.js');
Expand Down

0 comments on commit 1ea7cfd

Please sign in to comment.