Elderjs / template

Elder.js template project. It is part template, part tutorial. Dive in!
https://elderjs.pages.dev/
MIT License
113 stars 32 forks source link

Environment Variables and Production Build #43

Closed apop880 closed 3 years ago

apop880 commented 3 years ago

I noticed that when I run npm run dev:rollup I can pull in items from my .env file just fine to connect to my backend API, but when I run npm run build that's not the case. I was able to fix this by adding require('dotenv').config(); to the top of my elder.config.js file. Happy to PR this change to the template, but wanted to check first and see if there's a better way to do this or another reason I'm missing that it's set up the way that it is.

nickreese commented 3 years ago

@apop880 Pushed a fix. You nailed how it should be done.