Skip to content

Commit 9c89cc3

Browse files
authored
fix(explorer): read env vars (#3709)
1 parent d8eef92 commit 9c89cc3

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

.changeset/proud-shirts-compete.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/explorer": patch
3+
---
4+
5+
Environment variables are now loaded from the `.env` file alongside those specified via CLI flags.

packages/explorer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"clsx": "^2.1.1",
6464
"cmdk": "1.0.0",
6565
"debug": "^4.3.4",
66+
"dotenv": "^16.0.3",
6667
"lucide-react": "^0.408.0",
6768
"monaco-editor": "^0.52.0",
6869
"next": "14.2.5",

packages/explorer/src/bin/explorer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
2+
import { config } from "dotenv";
23
import { rm } from "fs/promises";
34
import path from "path";
45
import process from "process";
@@ -12,6 +13,9 @@ const __filename = fileURLToPath(import.meta.url);
1213
const __dirname = path.dirname(__filename);
1314
const packageRoot = path.join(__dirname, "..", "..");
1415

16+
config({ path: path.join(packageRoot, ".env") });
17+
config({ path: path.join(packageRoot, ".env.local") });
18+
1519
const argv = yargs(process.argv.slice(2))
1620
.options({
1721
port: {

pnpm-lock.yaml

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)