From b239ee68f7dbfd52c1c2d95b6fbbb85adad1beec Mon Sep 17 00:00:00 2001 From: Esi're Date: Thu, 7 Oct 2021 12:11:53 +0100 Subject: [PATCH] Fix environment variable expansion. --- npm/package.json | 1 + npm/src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/npm/package.json b/npm/package.json index d3514e4..fb6b971 100644 --- a/npm/package.json +++ b/npm/package.json @@ -37,6 +37,7 @@ "debug": "^4.3.2", "deepmerge": "^4.2.2", "dotenv": "^10.0.0", + "dotenv-expand": "^5.1.0", "execa": "^5.1.1" } } diff --git a/npm/src/index.ts b/npm/src/index.ts index fc62255..8bb0f7f 100644 --- a/npm/src/index.ts +++ b/npm/src/index.ts @@ -6,6 +6,7 @@ import deepmerge from 'deepmerge' import execa from 'execa' import chalk from 'chalk' import dotenv from 'dotenv' +import dotenvExpand from 'dotenv-expand' import makeDebugger from 'debug' type VitePlugin = Plugin | ((...params: any[]) => Plugin) @@ -67,7 +68,7 @@ export class ViteConfiguration { config: (UserConfig | ((env: typeof process.env) => UserConfig)) = {}, artisan: PhpConfiguration = {}, ) { - dotenv.config() + dotenvExpand(dotenv.config()) debug('Loaded configuration with dotenv') // Sets the base directory.