From a0022f4b934cf3d93144dc270eb263d49cc6c4ac Mon Sep 17 00:00:00 2001 From: eggplantzzz Date: Wed, 11 Jan 2023 16:23:36 -0500 Subject: [PATCH] correct check for window variable --- packages/fetch-and-compile/.eslintrc.json | 5 ++++- packages/fetch-and-compile/lib/fetch.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/fetch-and-compile/.eslintrc.json b/packages/fetch-and-compile/.eslintrc.json index 00ea4852831..177b7d1f506 100644 --- a/packages/fetch-and-compile/.eslintrc.json +++ b/packages/fetch-and-compile/.eslintrc.json @@ -1,3 +1,6 @@ { - "extends": ["../../.eslintrc.package.json"] + "extends": ["../../.eslintrc.package.json"], + "env": { + "browser": "readonly" + } } diff --git a/packages/fetch-and-compile/lib/fetch.ts b/packages/fetch-and-compile/lib/fetch.ts index 8e4d6da65e2..31809162dc6 100644 --- a/packages/fetch-and-compile/lib/fetch.ts +++ b/packages/fetch-and-compile/lib/fetch.ts @@ -136,7 +136,7 @@ async function tryFetchAndCompileAddress( }); // @ts-ignore - if (window) { + if (typeof window === "undefined") { externalConfig.compilers.cache = "noCache"; }