I m trying to access my .env file variables using dotenv-webpack so that they can be bundled later and I can use them on my website, however I followed the instructions and have looked online and can t make it work.
//.env
VAR=1234
// created a webpack.config.js with the following code
const Dotenv = require( dotenv-webpack );
module.exports = {
plugins: [
new Dotenv()
]
};
// index.js
console.log(process.env.VAR);
// undefined
I m not sure what to do because I ve followed the example in: https://github.com/mrsteele/dotenv-webpack and it seems like it should be easy...