@fecp/designer 5.1.4 → 5.1.6
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/es/config-dev.js
CHANGED
package/es/config-prod.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
const IS_PROD = ["production", "prod"].includes("production");
|
|
2
1
|
function getEnvConfig() {
|
|
3
|
-
|
|
2
|
+
var _a, _b;
|
|
3
|
+
const isProd = ((_a = window.__ENV__) == null ? void 0 : _a.NODE_ENV) === "production" || ((_b = window.__ENV__) == null ? void 0 : _b.isProd);
|
|
4
|
+
const isProdByHost = /(prod|\.com$)/.test(window.location.hostname);
|
|
5
|
+
const finalIsProd = isProd ?? isProdByHost;
|
|
6
|
+
const configName = finalIsProd ? "configProd" : "configDev";
|
|
4
7
|
return window[configName] || window.parent[configName];
|
|
5
8
|
}
|
|
6
9
|
const envConfig = getEnvConfig();
|
package/lib/config-dev.js
CHANGED
package/lib/config-prod.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const IS_PROD = ["production", "prod"].includes("production");
|
|
4
3
|
function getEnvConfig() {
|
|
5
|
-
|
|
4
|
+
var _a, _b;
|
|
5
|
+
const isProd = ((_a = window.__ENV__) == null ? void 0 : _a.NODE_ENV) === "production" || ((_b = window.__ENV__) == null ? void 0 : _b.isProd);
|
|
6
|
+
const isProdByHost = /(prod|\.com$)/.test(window.location.hostname);
|
|
7
|
+
const finalIsProd = isProd ?? isProdByHost;
|
|
8
|
+
const configName = finalIsProd ? "configProd" : "configDev";
|
|
6
9
|
return window[configName] || window.parent[configName];
|
|
7
10
|
}
|
|
8
11
|
const envConfig = getEnvConfig();
|