Only merge dotenv if .env file exists
This commit is contained in:
		| @@ -50,7 +50,6 @@ | ||||
|   import IconSearch from "@/icons/IconSearch.vue"; | ||||
|   import IconClose from "@/icons/IconClose.vue"; | ||||
|   import type { Ref } from "vue"; | ||||
|   import config from "../../config"; | ||||
|   import type { MediaTypes } from "../../interfaces/IList"; | ||||
|  | ||||
|   interface ISearchResult { | ||||
|   | ||||
| @@ -13,11 +13,13 @@ const publicPath = path.resolve(__dirname, "public"); | ||||
| const isProd = process.env.NODE_ENV === "production"; | ||||
|  | ||||
| // Merge inn all process.env values that match dotenv keys | ||||
| Object.keys(process.env).forEach(key => { | ||||
| if (dotenv.parsed) { | ||||
|   Object.keys(process.env).forEach(key => { | ||||
|     if (key in dotenv.parsed) { | ||||
|       dotenv.parsed[key] = process.env[key]; | ||||
|     } | ||||
| }); | ||||
|   }); | ||||
| } | ||||
|  | ||||
| module.exports = { | ||||
|   mode: process.env.NODE_ENV, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user