Use serverless-s3-sync to copy the React build/ directory up to S3.
After getting the output of the CloudFormation stacks written, I need to do something to update the React runtime. I've tried to use serverless-plugin-scripts, but unfortunately I don't think the dynamic hooking and ordering can be made to work. It'd also be nice to avoid an extra dependency.
Purpose
This PR adds a preCommand option to s3Sync, allowing a command to be run before the folder is uploaded to S3:
Background
I'm attempting to have a single source project containing both React app and serverless spec, and have
sls deploy
:@lucas-carneiro/serverless-stack-output
to update React app with details from CloudFormationnpm build
serverless-s3-sync
to copy the Reactbuild/
directory up to S3.After getting the output of the CloudFormation stacks written, I need to do something to update the React runtime. I've tried to use
serverless-plugin-scripts
, but unfortunately I don't think the dynamic hooking and ordering can be made to work. It'd also be nice to avoid an extra dependency.Purpose
This PR adds a
preCommand
option tos3Sync
, allowing a command to be run before the folder is uploaded to S3: