Browse Source

Define `globalThis` in node preamble.

Herby Vojčík 2 months ago
parent
commit
c8375ea4a4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      sdk/lib/helpers.js

+ 2 - 1
sdk/lib/helpers.js

@@ -1,6 +1,7 @@
 function nodeWrapper() {
     return {
-        start: "(function(define, require){\n" +
+        start: "var globalThis = typeof globalThis === \"undefined\" ? global : globalThis || global;\n" +
+        "(function(define, require){\n" +
         "define(function (requirejs) {\n" +
         "var module = void 0; // Bad UMDs workaround\n" +
         "requirejs.resolve = require.resolve;\n" +