I have a configuration file that varies depending on the environment, so I added it to my `.gitignore` file.
In certain environments, the file may not exist at all. In such cases, default values will be used. Therefore, I am looking for a way to import a JSON file if it is present. The importing process can be done easily with this line of code:
import config from 'config.json';
If the file does not exist, an error message will display saying: "Error: Cannot find module 'config.json'."
My setup involves using Angular 8 and TypeScript.