You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
I believe the best course is to fully reset the cache, regardless of what directory it is in (though we still want to exclude node_modules), when any file that is part of the project has changed.
This means, when we detect a change in ModuleManager:
resetCache on NodeUtil can be called right away
There is no need for a dirty flag
We should not need the modules variable either - instead calling module should just immediately call require(filePath)
In this way, we can significantly simplify the logic while improving the functionality.
The text was updated successfully, but these errors were encountered:
It is still valid. The behavior we would like is that any time a file changes in the project, the modules cache is completely replaced.
Currently, when someone changes a file OTHER than the main lambda, the change is only "hot-loaded" when the user happens to also change the main lambda (i.e., index.js).
Per these changes on the serverless-plugin:
https://github.com/breathe/serverless-plugin-bespoken/blob/ea4ed854f91cb569862c4cf9f1016ba349a3083c/src/ServerlessPluginBespoken.ts#L20
And per this discussion:
I believe the best course is to fully reset the cache, regardless of what directory it is in (though we still want to exclude node_modules), when any file that is part of the project has changed.
This means, when we detect a change in ModuleManager:
require(filePath)
In this way, we can significantly simplify the logic while improving the functionality.
The text was updated successfully, but these errors were encountered: