2022-06-06 10:06:27 +00:00
|
|
|
const path = require("path");
|
|
|
|
require("dotenv").config({ path: path.join(__dirname, "..", "..", ".env") });
|
2022-05-27 15:37:02 +00:00
|
|
|
process.env.EMBED_PUBLIC_VERCEL_URL = process.env.VERCEL_URL;
|
|
|
|
process.env.EMBED_PUBLIC_WEBAPP_URL = process.env.NEXT_PUBLIC_WEBAPP_URL;
|
|
|
|
process.env.EMBED_PUBLIC_EMBED_LIB_URL = process.env.NEXT_PUBLIC_EMBED_LIB_URL;
|
2022-07-12 14:18:53 +00:00
|
|
|
process.env.EMBED_PUBLIC_EMBED_FINGER_PRINT = process.env.NEXT_PUBLIC_EMBED_FINGER_PRINT;
|
2022-05-27 15:37:02 +00:00
|
|
|
|
2022-06-04 13:17:02 +00:00
|
|
|
// Problem: typeof process.env.EMBED_PUBLIC_EMBED_LIB_URL is "undefined"(truthy) if process.env.NEXT_PUBLIC_EMBED_LIB_URL is undefined(falsy)
|
|
|
|
// This is probably because environment variables are always string, so this weird automatic conversion to string happens
|
|
|
|
// HACKY Solution
|
|
|
|
if (process.env.EMBED_PUBLIC_EMBED_LIB_URL === "undefined") {
|
|
|
|
delete process.env.EMBED_PUBLIC_EMBED_LIB_URL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.EMBED_PUBLIC_WEBAPP_URL === "undefined") {
|
|
|
|
delete process.env.EMBED_PUBLIC_WEBAPP_URL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.EMBED_PUBLIC_VERCEL_URL === "undefined") {
|
|
|
|
delete process.env.EMBED_PUBLIC_VERCEL_URL;
|
|
|
|
}
|
|
|
|
|
2022-05-27 15:37:02 +00:00
|
|
|
const viteBaseConfig = {
|
|
|
|
envPrefix: "EMBED_PUBLIC_",
|
|
|
|
};
|
|
|
|
export default viteBaseConfig;
|