Added node-env based env file configuration.

This commit is contained in:
Andrew Lalis 2023-02-17 13:14:26 +01:00
parent 9a8df73e7c
commit 97c69ea34d
1 changed files with 9 additions and 1 deletions

View File

@ -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 {