5

I'm migrating to Nuxt new runtime config from the @nuxtjs/dotenv module. I tried to follow the official guidelines, but I couldn't find a way to specify the path to my env files and my default .env file isn't loaded at build time.

Is there a way to set a .env file path in nuxt.config.js without using @nuxtjs/dotenv ?

belgacea
  • 1,084
  • 1
  • 15
  • 33

1 Answers1

0

I've just noticed this question. Do you mind trying this solution: https://stackoverflow.com/a/68338032/8816585?

Mostly specifying the path like this

yarn dev --dotenv variables/.env_file

Otherwise, this is also a solution (even if it's using dotenv...): https://stackoverflow.com/a/67987659/8816585

buildModules: ["@nuxtjs/fontawesome", ['@nuxtjs/dotenv', { path: './' }]],
kissu
  • 40,416
  • 14
  • 65
  • 133