From 3e552d0cbe157cb1bc174b7835e1213a50a32a9a Mon Sep 17 00:00:00 2001 From: Tae Jin Jang <48776412+Ryze0323@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:59:58 +0900 Subject: [PATCH 1/2] hot reload --- README.md | 3 +++ .../in-process-runner/aws-lambda-ric/UserFunction.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 2434f2a68..464de1d46 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# Ryze0323 Fork Version + +In the case of version 12.0.4, a speed issue occurred because all packages had to be read and processed each time when developing in a node environment. All folders except the node_modules folder have been changed to reflect user changes. # Serverless Offline

diff --git a/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js b/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js index 1542880a7..44e371716 100644 --- a/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js +++ b/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js @@ -334,6 +334,11 @@ const { pathToFileURL } = require('node:url') throw new MalformedStreamingHandler('Only response streaming is supported.') } module.exports.load = async function (appRoot, fullHandlerString) { + Object.keys(require.cache) + .filter((cache) => !cache.includes('node_modules')) + .forEach((item) => { + delete require.cache[item] + }) _throwIfInvalidHandler(fullHandlerString) const [moduleRoot, moduleAndHandler] = _moduleRootAndHandler(fullHandlerString) From 92c73c46e2f993e65116494185af88b817181720 Mon Sep 17 00:00:00 2001 From: Tae Jin Jang <48776412+Ryze0323@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:12:27 +0900 Subject: [PATCH 2/2] revert readme --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 464de1d46..2434f2a68 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -# Ryze0323 Fork Version - -In the case of version 12.0.4, a speed issue occurred because all packages had to be read and processed each time when developing in a node environment. All folders except the node_modules folder have been changed to reflect user changes. # Serverless Offline