-
Notifications
You must be signed in to change notification settings - Fork 29
Build: Streamline frontend config #999
Description
Background: Currently, in order to build the frontend workspace, one needs to create two files: index.html and firebase_config.ts. There are example files for each (index.example.html and firebase_config.example.ts). Minimally, one must copy the example files to build. The files themselves are .gitignored to prevent committing.
This design does prevent marginally sensitive values from being committed to the repo (such as the Firebase API key). However, it does not take full advantage of Webpack's ability to perform substitutions and inject environment variables.
Proposal:
- Delete both
*.example.*files. - Remove the exclusions from
.gitignore. - Make both files depend on Webpack-injected fields (no hard coded secrets).
- Check in the config-based files.
- Update GitHub Actions (`ci.yaml') as needed to build using the streamlined procedure.
- Update the Google Cloud Build (
cloudbuild.yaml) as needed. - Update documentation on how to build and deploy based on the updated method.
It may make sense to create files like firebase_config.dev.json and firebase_config.prod.json, the latter of which would be .gitignored. Then, in the Webpack build, bring in these files' contents for the particular kind of build being performed.
See #996 for discussion on streamlining the frontend build process.