title: Accessing dotenv (.env) variables and build mode in Vite config
body: <p>Following <a href="https://vitejs.dev/guide/env-and-mode.html" rel="nofollow noreferrer">Vite's dotenv guide</a>, I have been able to set up using .env variables in my project that depend on different modes (beta mode, production, etc) using different files (eg <code>.env.beta</code>, launching with <code>vite ... --mode beta</code>).</p>
  <p>However, I would like to make some modifications to the <code>vite.config.ts</code> depending on these modes. For example, if I build with <code>--mode beta</code> I would like to change the PWA title and icon path which is instantiated in vite config as a plugin, but these are defined in <code>vite.config.ts</code>, which as I understand does not have access to the env variables (eg <code>import.meta.env.VITE_BETA</code>).</p>
  <p>How can I get access to the build mode or env variables in <code>vite.config.ts</code> to change?</p>