Skip to content

Commit

Permalink
only apply polyfills where necessary - closes #7374
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Nov 15, 2022
1 parent ab2fac6 commit b1e6461
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-rivers-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Only apply polyfills where necessary
2 changes: 2 additions & 0 deletions packages/kit/src/exports/node/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const globals = {
// exported for dev/preview and node environments
export function installPolyfills() {
for (const name in globals) {
if (name in globalThis) continue;

Object.defineProperty(globalThis, name, {
enumerable: true,
configurable: true,
Expand Down

0 comments on commit b1e6461

Please sign in to comment.