serverless-components / website

:zap: Instantly deploy static website on serverless infrastructure with zero configuration using Serverless Components.
https://serverless.com
Apache License 2.0
155 stars 49 forks source link

Uploading just the static folder #76

Closed devlesedi closed 3 years ago

devlesedi commented 3 years ago

Hi I have a static website project with a folder structure as follows:

Gruntfile.js        compiled/       package-lock.json   serverless.yml      yarn.lock
README.md       metadata.json       package.json        src/

I just want to upload the compiled/ files to my website/bucket but it uploads everything including the node_modules.

Here is my serverless.yml file:

website:
  component: "@serverless/website"
  inputs:
    src:
      src: ./src          # the input source folder
      hook: yarn && yarn build # the hook you want to run
      dist: ./compiled        # the output dist folder
    bucketName: ${cdn.bucketName}
    # domain: www.example.com

cdn:
  component: "@serverless/cdn"
devlesedi commented 3 years ago

I found the correct solution.

website:
  component: "@serverless/website"
  inputs:
    code:
      src: ./compiled        # the output dist folder
      index: index.html
    bucketName: ${cdn.bucketName}
    # region: eu-central-1
    # domain: www.example.com

cdn:
  component: "@serverless/cdn"