version: 0.2

phases:
  install:
    runtime-versions:
      nodejs: 16
    commands:
      - echo Installing project dependencies....
      - npm install --force --legacy-peer-deps
  pre_build:
    commands:
      - echo "Setting environment variables"
      - export NODE_ENVIRONMENT='dev'
  build:
    commands:
      - echo Building the  application...
      - npm run build
  post_build:
    commands:
      - echo "Preparing artifacts for deployment"
      - zip -r dist.zip dist
      - echo "Build phase complete"
      

artifacts:
  files:
    - appspec.yml
    - before_scripts.sh
    - after_scripts.sh
    - application_start.sh
    - dist.zip