vite-plugin-meta-env-dts for vite.
npm i vite-plugin-meta-env-dts
// vite.config.js
import metaEnvDts from 'vite-plugin-meta-env-dts'
export default defineConfig({
plugins: [metaEnvDts({ /* options */ })],
})
type string | string[]
default ['.env.*']
type string | string[]
default ['VITE_']
type string | false
default 'types/auto-meta-env.d.ts'