Monorepo Setup
Local Setup
-
Clone the project:
Terminal window git clone https://github.com/alexnguyennz/astro-aws-amplify -
Install the project:
Terminal window pnpm install -
Build any of the demos after making changes to
packages/astro-aws-amplify:Terminal window turbo build --filter blog# turbo build --filter base-path, etc. -
To run a demo locally:
Terminal window turbo dev --filter blog# turbo dev --filter base-path, etc.
Amplify Hosting Deployment
-
Connect the monorepo repository.
-
Tick “Connecting a monorepo? Pick a folder.” and enter the path to the demo you want to deploy:
Terminal window demos/blog -
If you want to deploy another demo, change it in
amplify.yml- you can’t override this file’s settings in the Amplify Hosting panel. -
Set an environment variable to use Node.js 18:
Amplify Environment Variables _CUSTOM_IMAGE=amplify:al2023
Build specification example:
version: 1applications: - appRoot: demos/blog frontend: phases: preBuild: commands: - npm i -g pnpm - pnpm config set store-dir .pnpm-store - pnpm i build: commands: - pnpm run build artifacts: baseDirectory: .amplify-hosting files: - "**/*" cache: paths: - .pnpm-store/**/*