nuxt3 build .env !!
You want Build time use .env setting context. Two way:
-
source .env
package.json > “build”: “source .env && nuxt build” -
eval $(grep ‘^NUXT_’ .env)
package.json > “build”: “eval $(grep ‘^PROD_’ .env) && nuxt build”
^RROD_ can replace by yourself
.env file inside
PROD_API_URL=https://ooxxooxx