Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vite Vue3 place multiple ".env" files in a folder

I have 11 .env files for testing and other reasons.

Is there way I can put them in a folder and use them from there?

Such as:

  • /root
    • env-container
      • .env-test1
      • .env-test2
      • .env-test3
like image 563
sunflower seed Avatar asked Oct 28 '25 09:10

sunflower seed


1 Answers

You can configure the location of the .env files with the envDir config:

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  envDir: './root/env-container',
})
like image 190
tony19 Avatar answered Oct 31 '25 04:10

tony19



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!