Skip to content

Commit

Permalink
Add comment regarding new plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
twk3 committed Dec 18, 2023
1 parent 819f990 commit 967652f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/desktop-client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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`,
},
Expand Down

0 comments on commit 967652f

Please sign in to comment.