How can i make sure dotenv is loaded


So, the dotenv config is placed below the requires, how can i make sure it will always be above?

You can use @@directive feature which puts its contents above everything else:

@@directive(`require("dotenv")`)
3 Likes

You mean the Dotenv.config() call? It shouldn’t be above requires (not before require("dotenv") at least), or you’ll end up trying to access a property of Dotenv before it’s assigned a value.