Skip to content

Commit

Permalink
fix: avoid loading optional module for jsdom (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jul 1, 2023
1 parent 026f4ed commit 0a39eef
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/vscode/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ await Promise.all([
}));
},
},
{
name: "jsdom-fix",
setup(build) {
build.onLoad(
{ filter: /\/jsdom\/.*\/XMLHttpRequest-impl\.js$/ },
async (args) => {
return {
loader: "js",
contents: (await fs.readFile(args.path, "utf8")).replace(
'require.resolve ? require.resolve("./xhr-sync-worker.js") :',
""
),
};
}
);
},
},
],
}).then(async (result) => {
if (isProd) {
Expand Down

0 comments on commit 0a39eef

Please sign in to comment.