Currently inside of next build, the application always points to the 'prod' s3 bucket to grab the code splitting files generated by Next.js.
We need next-build to grab its compiled files based on where the application is being ran (i.e, dev, staging).
To help with the work being done in #538 we will need to create a .env file for our dev environment and make sure that the proper environment is being referenced when we attempting to access compiled files to prevent CSP and CORS errors.
[ ] Next build points to the proper s3 bucket based on which environment it has been built for.
Testing
For testing you should be able to build the application and set APP_ENV=dev. Doing so should allow you to check your network path and make sure that the paths are what we are expecting.
An example of what this looks like when it is not working can be seen at https://dev.va.gov/outreach-and-events/events/68114/
This fix is just for the code split files and not the .css or font assets
Description
Currently inside of next build, the application always points to the 'prod' s3 bucket to grab the code splitting files generated by Next.js. We need next-build to grab its compiled files based on where the application is being ran (i.e, dev, staging). To help with the work being done in #538 we will need to create a .env file for our dev environment and make sure that the proper environment is being referenced when we attempting to access compiled files to prevent CSP and CORS errors.
Supporting Details
The path to the compiled files can be found at https://github.com/department-of-veterans-affairs/next-build/blob/867a6aaa01ce82bc065ed8ebdf0d065bca36fa23/next.config.js#L16C1-L17C1 Ideally assetPrefix should point to the proper bucket (prod,dev,staging) based on what APP_ENV has been set to. AWS Bucket locations can be found in the infrastructure.md file
Acceptance Criteria
Testing
For testing you should be able to build the application and set APP_ENV=dev. Doing so should allow you to check your network path and make sure that the paths are what we are expecting. An example of what this looks like when it is not working can be seen at https://dev.va.gov/outreach-and-events/events/68114/ This fix is just for the code split files and not the .css or font assets