From b6e735be601d39beeaf4e9cdb22cb30189cfd988 Mon Sep 17 00:00:00 2001 From: Kevin Ries Date: Tue, 17 Oct 2023 17:12:46 +0200 Subject: [PATCH] fix: removed custom require implementation --- .../cli/lib/commands/start/createWatchMiddlewares.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/core/cli/lib/commands/start/createWatchMiddlewares.js b/packages/core/cli/lib/commands/start/createWatchMiddlewares.js index a83b2ecb..fdd0ed56 100644 --- a/packages/core/cli/lib/commands/start/createWatchMiddlewares.js +++ b/packages/core/cli/lib/commands/start/createWatchMiddlewares.js @@ -38,16 +38,6 @@ function isWeaveConfigFile (filename) { * @returns {any} Middleware */ function createWatchMiddleware (weaveCli, options) { - Module.prototype.require = function () { - const result = originalRequire.apply(this, arguments); - - if (!isFunction(result) && result.name) { - result.__filename = path.join(this.path, arguments[0]); - } - - return result; - }; - return function watchMiddleware (runtime) { let projectFiles = new Map(); let previousProjectFiles = new Map(); @@ -279,7 +269,7 @@ function createWatchMiddleware (weaveCli, options) { } }, serviceCreated (service, schema) { - if (!service.filename) { + if (!service.filename && schema.__filename) { service.filename = schema.__filename; } }