# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 version: 0.2 phases: install: runtime-versions: nodejs: 16 commands: # Install all dependencies (including dependencies for running tests) - cd ./javascript-appsync-sam-vtl - npm install pre_build: commands: # Discover and run unit tests in the '__tests__/unit' directory # - npm run test:unit # Remove all unit tests to reduce the size of the package that will be ultimately uploaded to Lambda - rm -rf ./__tests__ # Remove all dependencies not needed for the Lambda deployment package (the packages from devDependencies in package.json) - npm prune --production build: commands: # Use AWS SAM to package the application by using AWS CloudFormation - sam package --template template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file application.yaml artifacts: discard-paths: yes files: - ./javascript-appsync-sam-vtl/* - ./javascript-appsync-sam-vtl/application.yaml - ./shared/cognito.yaml