From 967652f55771dba58077c06810d0530a96be0f96 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Sat, 16 Dec 2023 18:18:01 -0800 Subject: [PATCH] Add comment regarding new plugin --- packages/desktop-client/vite.config.mts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/desktop-client/vite.config.mts b/packages/desktop-client/vite.config.mts index 4a0f52e02b2..fe5e14cdb3c 100644 --- a/packages/desktop-client/vite.config.mts +++ b/packages/desktop-client/vite.config.mts @@ -23,6 +23,7 @@ const addWatchers = (): Plugin => ({ }, }); +// Inject build shims using the inject plugin const injectShims = (): Plugin[] => { const buildShims = path.resolve('./src/build-shims.js'); const commonInject = { @@ -34,6 +35,8 @@ const injectShims = (): Plugin[] => { { name: 'inject-build-process', config: () => ({ + // rename process.env in build mode so it doesn't get set to an empty object up by the vite:define plugin + // this isn't needed in serve mode, because vite:define doesn't empty it in serve mode. And defines also happen last anyways in serve mode. define: { 'process.env': `_process.env`, },