Skip to content

Commit

Permalink
hot reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryze0323 committed Sep 17, 2023
1 parent eb12f34 commit 3e552d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3e552d0

Please sign in to comment.