@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.
- package/dist/builder-react-lite.cjs.js +1 -1
- package/dist/builder-react-lite.cjs.js.map +1 -1
- package/dist/builder-react-lite.esm.js +1 -1
- package/dist/builder-react-lite.esm.js.map +1 -1
- package/dist/builder-react.browser.js +1 -1
- package/dist/builder-react.browser.js.map +1 -1
- package/dist/builder-react.cjs.js +1 -1
- package/dist/builder-react.cjs.js.map +1 -1
- package/dist/builder-react.es5.js +1 -1
- package/dist/builder-react.es5.js.map +1 -1
- package/dist/builder-react.unpkg.js +1 -1
- package/dist/builder-react.unpkg.js.map +1 -1
- package/dist/lib/package.json +1 -1
- package/dist/lib/src/functions/safe-dynamic-require.js +2 -1
- package/dist/lib/src/functions/safe-dynamic-require.js.map +1 -1
- package/package.json +1 -1
- package/src/functions/safe-dynamic-require.ts +1 -1
package/dist/lib/package.json
CHANGED
|
@@ -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;;;
|
|
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
|
@@ -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
|
|