'Multiple environment declarations for TypeScript?

I've been searching for a way to emulate Angular's handling of different environments with its staging.environment.ts and production.environment.ts in vanilla TypeScript, however could not find a single mention of it anywhere. The TS compiler options don't mention anything that would allow me choose between different environment files to include in compilation.

What I'm ultimately looking for would be a CLI flag allowing me to do exactly this. Have I missed something somewhere?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source