diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 8d5c5c9b08..17169528d3 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -22,13 +22,7 @@ const fetch = require("node-fetch") const DEFAULT_AUTOMATION_BUCKET = "https://prod-budi-automations.s3-eu-west-1.amazonaws.com" const DEFAULT_AUTOMATION_DIRECTORY = ".budibase-automations" -const NODE_MODULES_PATH = join( - __dirname, - "..", - "..", - "..", - "node_modules" -) +const NODE_MODULES_PATH = join(__dirname, "..", "..", "..", "node_modules") /** * The single stack system (Cloud and Builder) should not make use of the file system where possible, @@ -178,12 +172,15 @@ exports.getComponentLibraryManifest = async (appId, library) => { const path = require.resolve(library).split(lib)[0] return require(join(path, lib, filename)) } else if (env.isDev()) { - return require(join( + const path = join( NODE_MODULES_PATH, "@budibase", "standard-components", filename - )) + ) + // always load from new so that updates are refreshed + delete require.cache[require.resolve(path)] + return require(path) } const path = join(appId, "node_modules", library, "package", filename) let resp = await retrieve(ObjectStoreBuckets.APPS, path)