Ya'll, the NextjsSite construct deploys the lambas via an S3 Asset and then does environment variable replacement. I understand the need to inline the environment variables via a find and replace. Is this specific strategy required so that the environment variables don't end up in the build artifacts? Just wondering if a simpler strategy such as Esbuild's define argument could be used instead.
t
thdxr
06/07/2022, 1:51 PM
the issue is the variable values aren't know at synth time
thdxr
06/07/2022, 1:51 PM
Only after deployment
s
Sean Matheson
06/07/2022, 1:51 PM
Aha, of course. Makes sense.
Sean Matheson
06/07/2022, 1:51 PM
Thanks for the insight
Sean Matheson
06/07/2022, 1:53 PM
You had to jump through hoops to make that work. Along with the any base region deployments. Wow. That stuff is complicated
Sean Matheson
06/07/2022, 1:54 PM
Amazing how much complexity these constructs hide away with a simple API