Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

add coments

Sara Vieira3ad31f6e054e
diff --git a/env-check.js b/env-check.js
index d35e21f4d7..0ed05d5901 100644
--- a/env-check.js
+++ b/env-check.js
@@ -4,10 +4,12 @@
* It has to be a `.js`-file to be imported there.
*/
-// Remix does not read .env files when building for production
+// Remix does not read .env files when building for production so this would make it to that when you tried to run yarn build locally
+// you would get an error because your environment variables are in the .env file.
+// `dot-env` makes it so that when you run this file the `process.env` is always populated with your `.env` file if it finds one,
+// if not it will read the environment variables set by your hosting provider like remix does.
// eslint-disable-next-line @typescript-eslint/no-var-requires
-const dotenv = require("dotenv");
-dotenv.config();
+require("dotenv").config();
const REQUIRED_ENVS = ["DATABASE_URL", "AUTH_SECRET"];