ElMassimo / ElMassimo/vite-plugin-environment
Issue with Vite v5
Open
- Dominant language
- TypeScript
- Stars
- 160
- Forks
- 10
- Avg merge
- 16h 23m
- Merged PRs (30d)
- 1
Description
I found that this plugin no longer works in Vite v5. Notably, according to [their docs about how they changed define](https://vitejs.dev/guide/migration.html#rework-define-and-import-meta-env-replacement-strategy), esbuild is now used to manage environment variables during build this.
Notably, this seams to mean
```js
export default defineConfig({
plugins: [EnvironmentPlugin('all')],
```
No longer works, and instead I had to add to `esbuildOptions` instead
```js
optimizeDeps: {
esbuildOptions: {
define: {
// add envs here (can't use vite-plugin-environment for this)
},
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.