@1f8/sls-spa-plugin

A plugin to simplify deploying Single Page Application using S3 and CloudFront

Usage no npm install needed!

<script type="module">
  import 1f8SlsSpaPlugin from 'https://cdn.skypack.dev/@1f8/sls-spa-plugin';
</script>

README

Credits

Updated from serverless-spa

yaml options

  • distribution options are optional
  • bucket name options are recommended
custom:
  spa:
    path: pathToSpaBuild
    bucketDev: name of s3 bucket to sync to
    distributionDev: cloudfront distribution ID
    bucketProd: name of s3 bucket to sync to
    distributionProd: cloudfront distribution ID

yaml example

custom:
  spa:
    path: ../client/build
    bucketDev: app-webapp-dev
    distributionDev: D39SDFKDSLJFDS
    bucketProd: app-webapp-prod
    distributionProd: D5SKDJKFLSJDF