From 02132e5b8183b0ee73e52d75ff6e28ff0c9fe3d2 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 17 Jun 2024 17:08:13 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Pick=20PR=20#58895=20(Fix=20glob?= =?UTF-8?q?al=20when=20typescript.js=20loade...)=20into=20release-5.5=20(#?= =?UTF-8?q?58896)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- Herebyfile.mjs | 2 +- scripts/browserIntegrationTest.mjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Herebyfile.mjs b/Herebyfile.mjs index 8447834a633..dac359b24de 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -216,7 +216,7 @@ function createBundler(entrypoint, outfile, taskOptions = {}) { // Monaco bundles us as ESM by wrapping our code with something that defines module.exports // but then does not use it, instead using the `ts` variable. Ensure that if we think we're CJS // that we still set `ts` to the module.exports object. - options.footer = { js: `})(typeof module !== "undefined" && module.exports ? module : { exports: ts });\nif (typeof module !== "undefined" && module.exports) { ts = module.exports; }` }; + options.footer = { js: `})({ get exports() { return ts; }, set exports(v) { ts = v; if (typeof module !== "undefined" && module.exports) { module.exports = v; } } })` }; // esbuild converts calls to "require" to "__require"; this function // calls the real require if it exists, or throws if it does not (rather than diff --git a/scripts/browserIntegrationTest.mjs b/scripts/browserIntegrationTest.mjs index f1fab43f221..7b3021f9793 100644 --- a/scripts/browserIntegrationTest.mjs +++ b/scripts/browserIntegrationTest.mjs @@ -29,6 +29,7 @@ for (const browserType of browsers) { await page.setContent(` + `);