Vite

Process.env has been removed by Vite, for now you'll need to add this line to your config:

define: {
    'process.env': process.env
  }

Using a basic example, here is your vite.config.ts:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  define: {
    'process.env': process.env
  }
})

Last updated