Skip to content

Commit

Permalink
Fix missing name & short_name inside webmanifest
Browse files Browse the repository at this point in the history
Need to pass env prefix to loadEnv too
  • Loading branch information
cheeaun committed Jan 5, 2024
1 parent 3989b21 commit 2bc1b83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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),
Expand Down

0 comments on commit 2bc1b83

Please sign in to comment.