Alternative approach to fixing serverless-webpack hot reload integration #1090
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements an alternative approach to #1050 for fixing #931. The concept here is fairly simple in that we hook the
after:webpack:compile:watch:compile
event fromserverless-weback
in order to trigger a forced cleanup of the Lambda functions.I've also made a change to the default configuration by setting
allowCache: true
. This should address a wide range of issues that have been reported recently against thev6.7.0
release, albeit at the expense of hot reload working with the default options.The overall upside here is that we get all the benefits of the caching behavior (including maintaining out of box compatibility with things like the
aws-sdk
) while still being able to support hot reloading. In my testing this has been very performant and reliable so far.Limitations
serverless-webpack
useWorkerThreads: true
)serverless-webpack
isn't very elegantAdditional Issues Addressed
TODO