I started working on a project the has some API keys that need to be protected. My personal projects are all using React and Node, but this project is built using yarn (which I'm unfamiliar with). I have ran yarn add dotenv already, and I've tried using their documentation to get it up and running. All of the console.log(process.env.***) return undefined.
My method so far has been to add my variables to the .env file found in the root of the project, and add require('dotenv').config() to the project's application.js file to be loaded. I read that Vue.js 3 doesn't require dotenv and instead uses _VUE_APP prepended to the variable name (which I've tried to make sure it doesn't work that way with Vue 2.8. Spoiler, it does not).
Is there a step I'm missing? Should I take a different approach altogether?
Thanks in advance!