Missing Build settings in AWS Amplify Hosting for Flutter Web Apps deployment

0

I'm trying to use AWS Amplify Hosting to deploy my Flutter Web App. as you may know, amplify is supporting flutter web apps now, but looks like there is something missing in build settings. After I finished attaching my GitHub repository, the build failed and as you can see in the screenshot, the build command is empty. Any idea what should we put there for flutter web apps?

I followed this tutorial and as you can see for ReactJS there is something to build the project but it is missing for Flutter Web Apps.

Enter image description here

Reza
已提問 1 年前檢視次數 174 次
1 個回答
0

You will need to build your backend and frontend. For my amplify backend I'm using typescript so I need to install typescript in the preBuild phase.

For the frontend you will need to install flutter and then build your app. My build command is in a Makefile, but something like flutter build web --release should work

version: 1
backend:
  phases:
    preBuild:
      commands:
        - npm install
        - npm install -g typescript
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm install -g gulp
        - yum install -y xz
        - curl -LO https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.16.2-stable.tar.xz
        - tar xf flutter_linux_3.16.2-stable.tar.xz -C /usr/local
        - export PATH="/usr/local/flutter/bin:$PATH"
        - git config --global --add safe.directory /usr/local/flutter
    build:
      commands:
        - make build
  artifacts:
    # IMPORTANT - Please verify your build output directory
    baseDirectory: build/web/
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
Daniel
已回答 4 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南