mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
github debug
This commit is contained in:
@@ -30,23 +30,18 @@ export function edgeDomainToKey(domain: string) {
|
|||||||
|
|
||||||
// get edge config server-side (prefer DomainContext when available), domain is the hostname
|
// get edge config server-side (prefer DomainContext when available), domain is the hostname
|
||||||
export async function getConfig() {
|
export async function getConfig() {
|
||||||
const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;
|
|
||||||
|
|
||||||
if ("1" === "1") {
|
|
||||||
console.error("process.env", process.env);
|
|
||||||
throw new Error("hello");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isCI) {
|
if (isCI) {
|
||||||
// "noop"
|
// "noop"
|
||||||
return require("../../config-template").localConfig;
|
return require("../../config-template").localConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.NEXT_PUBLIC_ENV === "development") {
|
if (process.env.NEXT_PUBLIC_ENV === "development") {
|
||||||
|
// helps to
|
||||||
const configPath = "../../config";
|
const configPath = "../../config";
|
||||||
return require(configPath).localConfig;
|
return require(configPath).localConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;
|
||||||
let config = await get(edgeDomainToKey(domain));
|
let config = await get(edgeDomainToKey(domain));
|
||||||
|
|
||||||
if (typeof config !== "object") {
|
if (typeof config !== "object") {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// next.js tries to run all the lib code during build phase; we don't always want it when e.g. we have connections initialized we don't want to have
|
// next.js tries to run all the lib code during build phase; we don't always want it when e.g. we have connections initialized we don't want to have
|
||||||
export const isBuildPhase = process.env.NEXT_PHASE?.includes("build");
|
export const isBuildPhase = process.env.NEXT_PHASE?.includes("build");
|
||||||
|
// for future usage - could be useful for "next build" conditional executions
|
||||||
export const isCI =
|
export const isCI =
|
||||||
process.env.CI === "true" ||
|
process.env.CI === "true" ||
|
||||||
process.env.IS_CI === "true" ||
|
process.env.IS_CI === "true" ||
|
||||||
|
|||||||
Reference in New Issue
Block a user