Skip to content

Commit

Permalink
fix: safely polyfill process.env
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Jul 16, 2021
1 parent 5dec44a commit 75d70c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/buildOptimizations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// We need to polyfill process if it doesn't exist, such as in the browser.
process ||= process || { env: {} };
if (typeof process === "undefined") {
globalThis.process = { env: {} } as typeof process;
}

/**
* `true` if in the production environment, `false` otherwise.
Expand Down

0 comments on commit 75d70c7

Please sign in to comment.