Fix env not working in vite config

So the manifest can't even get the name 🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️
pull/20/head
Lim Chee Aun 2022-12-22 19:38:02 +08:00
rodzic a1fef8fd1d
commit 11c5b02832
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -1,10 +1,13 @@
import preact from '@preact/preset-vite';
import { execSync } from 'child_process';
import { resolve } from 'path';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
const { VITE_CLIENT_NAME: CLIENT_NAME, NODE_ENV } = process.env;
const { VITE_CLIENT_NAME: CLIENT_NAME, NODE_ENV } = loadEnv(
'production',
process.cwd(),
);
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();