I am using AWS Amplify with the following configuration:
- https://dev.example.com/ - AWS Amplify - branch = dev
- https://example.com/ - AWS Amplify - branch = master
In gulpfile.js I have rules applied for production (minification etc using)
const isProd = process.env.NODE_ENV === 'prod'
This is my amplify.yaml
version: 1
frontend:
phases:
# IMPORTANT - Please verify your build commands
build:
# commands: []
commands:
npm run build:$BUILD_ENV
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: /docs
files:
- '**/*'
cache:
paths: []
I tried applying prod to ONLY master. I only want the prod mode to be applied and ran for the master. When I run the build.. dev branches shows unminified HTML and so does production. It is working and building but the prod mode is not being reflected in production so it is not executing my build prod command.
I searched online and also applied Environment variables AND followed this documentation which shows the build process "https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html" as follows:
Still is not working.
