[Vuejs]-Vue 3 cross-env variable is undefined

0👍

You should add it to .env file when client side useage

package.json

{"something": "cross-env NODE_ENV=development cross-env VUE_APP_MODE=something && npm run serve"}

.env

VUE_APP_MODE=${VUE_APP_MODE}

index.js

console.log(process.env.VUE_APP_MODE)

Leave a comment