serverless-bundle icon indicating copy to clipboard operation
serverless-bundle copied to clipboard

Is there a way to cache packaging between calls to deploy or package?

Open henhal opened this issue 4 years ago • 0 comments

In my CI pipeline I have a verifier job that runs tests and then calls sls package to make sure the code can be packaged and that lint is happy. If successful, it proceeds to call sls deploy.

This means webpack is invoked twice, which adds several minutes to the deploy chain.

A similar scenario is when deploying locally and making a small change to serverless.yml, then sls deploy will repackage with webpack from scratch.

Is there any way to get the plugin to reuse a packaged artifact if it's unchanged, for example by remembering a checksum of the source folder etc? Or perhaps by manually calling sls deploy with some option meaning don't repackage if artifact exists?

henhal avatar Jul 20 '21 20:07 henhal