From 1505dcbc667e317a8b2e721c0621605bb6c68c6e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 16 Sep 2022 11:25:28 +0100 Subject: [PATCH] Minor fix - datasource hot reloading was working apart from the the CJS require caching, need to clear down the cache entry before reloading. --- packages/server/src/utilities/fileSystem/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 96d8c85e0b..21a2a550f2 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -412,6 +412,7 @@ exports.getDatasourcePlugin = async (name, url, hash) => { return require(filename) } else { console.log(`Updating plugin: ${name}`) + delete require.cache[require.resolve(filename)] fs.unlinkSync(filename) } }