@builder.io/react 2.0.10-1 → 2.0.10-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/react",
3
- "version": "2.0.10-0",
3
+ "version": "2.0.10-1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/builder-react.cjs.js",
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.safeDynamicRequire = void 0;
4
+ var sdk_1 = require("@builder.io/sdk");
4
5
  var noop = function () { return null; };
5
6
  /*
6
7
  * The if condition below used to be
@@ -24,7 +25,7 @@ var noop = function () { return null; };
24
25
  * 2. Client -> typeof require === 'function' does not work because of overoptimization by the compiler
25
26
  * 3. Cloudflare edge -> only globalThis.require works
26
27
  */
27
- if (typeof globalThis.require === 'function' || typeof require === 'function') {
28
+ if (typeof globalThis.require === 'function' || sdk_1.Builder.isServer && (typeof require === 'function')) {
28
29
  exports.safeDynamicRequire = eval('require');
29
30
  }
30
31
  exports.safeDynamicRequire !== null && exports.safeDynamicRequire !== void 0 ? exports.safeDynamicRequire : (exports.safeDynamicRequire = noop);
@@ -1 +1 @@
1
- {"version":3,"file":"safe-dynamic-require.js","sourceRoot":"","sources":["../../../../src/functions/safe-dynamic-require.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAIb,IAAM,IAAI,GAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;AAKxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,UAAU,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;IAC7E,0BAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;CACtC;AAED,0BAAkB,aAAlB,0BAAkB,cAAlB,0BAAkB,IAAlB,0BAAkB,GAAK,IAAW,EAAC"}
1
+ {"version":3,"file":"safe-dynamic-require.js","sourceRoot":"","sources":["../../../../src/functions/safe-dynamic-require.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,uCAA0C;AAE1C,IAAM,IAAI,GAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;AAKxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,UAAU,IAAI,aAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,OAAO,KAAK,UAAU,CAAC,EAAE;IACnG,0BAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;CACtC;AAED,0BAAkB,aAAlB,0BAAkB,cAAlB,0BAAkB,IAAlB,0BAAkB,GAAK,IAAW,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/react",
3
- "version": "2.0.10-1",
3
+ "version": "2.0.10-2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/builder-react.cjs.js",
@@ -29,7 +29,7 @@ export let safeDynamicRequire: typeof require;
29
29
  * 2. Client -> typeof require === 'function' does not work because of overoptimization by the compiler
30
30
  * 3. Cloudflare edge -> only globalThis.require works
31
31
  */
32
- if (typeof globalThis.require === 'function' || typeof require === 'function') {
32
+ if (typeof globalThis.require === 'function' || Builder.isServer && (typeof require === 'function')) {
33
33
  safeDynamicRequire = eval('require');
34
34
  }
35
35