From 2bc1b8387e93700688772e9a93d774d81d105353 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 5 Jan 2024 09:14:09 +0800 Subject: [PATCH] Fix missing name & short_name inside webmanifest Need to pass env prefix to loadEnv too --- vite.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index d2ce17d1..3654ea8d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,11 +9,12 @@ import htmlPlugin from 'vite-plugin-html-config'; import { VitePWA } from 'vite-plugin-pwa'; import removeConsole from 'vite-plugin-remove-console'; +const allowedEnvPrefixes = ['VITE_', 'PHANPY_']; const { NODE_ENV } = process.env; const { PHANPY_CLIENT_NAME: CLIENT_NAME, PHANPY_APP_ERROR_LOGGING: ERROR_LOGGING, -} = loadEnv('production', process.cwd()); +} = loadEnv('production', process.cwd(), allowedEnvPrefixes); const now = new Date(); let commitHash; @@ -35,7 +36,7 @@ const rollbarCode = fs.readFileSync( // https://vitejs.dev/config/ export default defineConfig({ base: './', - envPrefix: ['VITE_', 'PHANPY_'], + envPrefix: allowedEnvPrefixes, mode: NODE_ENV, define: { __BUILD_TIME__: JSON.stringify(now),