vite-plugin-environment
vite-plugin-environment copied to clipboard
Issue with Vite v5
I found that this plugin no longer works in Vite v5. Notably, according to their docs about how they changed define, esbuild is now used to manage environment variables during build this.
Notably, this seams to mean
export default defineConfig({
plugins: [EnvironmentPlugin('all')],
No longer works, and instead I had to add to esbuildOptions instead
optimizeDeps: {
esbuildOptions: {
define: {
// add envs here (can't use vite-plugin-environment for this)
},
}
}