DISCLAIMER: Unfortunately this method is manual, but eventually needs to be done just the first time you create the Amplify Environment.
You need to have the aws-exports.js
file (generated by Amplify) to do this process.
We're gonna use a Environment variable (in my case BASE64_AWS_EXPORTS
) that will contain the aws-exports.js
file content encoded in base64
.
The script will then decode it and create the aws-exports.js
file.
The package.json
needs to be changed so that this script will be created before the build.
I used this website for manually encode the content of the aws-exports.js
file.