How to use env files in Vue.js version 3 with Vite

  • 2 days ago
In Vue 3, environment variables can be used to configure different settings based on the environment. In Vue 3 (with Vite as the build tool), environment variables must be prefixed with VITE_ to be exposed to your application code.
Transcript
00:00Environment variables are supported in Vue.js version 3 and we just need to add the right prefix at the beginning of each variable.
00:22To use this variable in a Vue.js component, we need to use import-meta-env and variable.

Recommended