From 97c69ea34d6162bd3ec8c51d680eff927332f87f Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Fri, 17 Feb 2023 13:14:26 +0100 Subject: [PATCH] Added node-env based env file configuration. --- gymboard-app/quasar.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gymboard-app/quasar.config.js b/gymboard-app/quasar.config.js index 70c8a04..a4d2740 100644 --- a/gymboard-app/quasar.config.js +++ b/gymboard-app/quasar.config.js @@ -12,7 +12,15 @@ const { configure } = require('quasar/wrappers'); const path = require('path'); const { withCtx } = require('vue'); -require('dotenv').config(); +// Load environment variables from different files depending on if we're in development. +let envPath = '.env.production'; +if (process.env.NODE_ENV === 'development') { + envPath = '.env.development'; +} +const result = require('dotenv').config({debug: true, path: envPath}); +if (result.error) { + throw result.error; +} module.exports = configure(function (ctx) { return {