I have a React project in Vite, and I want to be able to have custom environment-based extensions, e.g. .foo.ts and .bar.ts where the foo and bar versions of the files should be used depending on the existence of an environment variable, e.g. CUSOMER=foo, and the default extension (bare .ts) is used for all others.
What is the best way to configure this?
I've tried creating a custom resolver in vite, and tried using https://www.npmjs.com/package/@rollup/plugin-alias but I can't quite get the hang of it.