Skip to content

Commit 225f1e3

Browse files
committed
fix(template): __dirname is not defined in ES module scope
1 parent 604ca3b commit 225f1e3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://www.mongodb.com/atlas/database
2+
API_KEY=xxx
3+
API_BASE_URL=xxx
4+
DATASOURCE=xxx
5+
DATABASE=xxx
6+
COLLECTION=xxx

packages/templates/src/enum.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22
import path from 'path'
3+
import { fileURLToPath } from 'url'
34
import dotenv from 'dotenv'
45

6+
const __filename = fileURLToPath(import.meta.url)
7+
const __dirname = path.dirname(__filename)
8+
59
dotenv.config({
610
path: path.resolve(__dirname, '../../../.env'),
711
})

0 commit comments

Comments
 (0)