justindra
05/31/2022, 1:15 AMexpo build:web
and when I print out the ENV, I just get the following instead of it being filled properly.
REACT_APP_COGNITO_USER_POOL_ID: '{{ REACT_APP_COGNITO_USER_POOL_ID }}',
REACT_APP_AWS_REGION: 'us-west-2',
REACT_APP_API_ENDPOINT: '{{ REACT_APP_API_ENDPOINT }}',
The defn:
new StaticSite(this, 'ClientApp', {
path: 'frontend/client',
buildOutput: 'web-build',
buildCommand: 'npm run build:web',
errorPage: 'redirect_to_index_page',
environment: {
REACT_APP_AWS_REGION: scope.region,
REACT_APP_COGNITO_USER_POOL_ID: this.auth.userPoolId || '',
REACT_APP_COGNITO_USER_POOL_CLIENT_ID: this.auth.userPoolClientId || '',
REACT_APP_API_ENDPOINT: this.api.url,
REACT_APP_COGNITO_DOMAIN: rootDomain,
},
});
Frank
{{REACT_APP_COGNITO_USER_POOL_ID}}
) are used at build time. And they are replaced with the real value at deploy time (ie. after the user pool is deployed).Frank
Frank
justindra
05/31/2022, 2:30 PM