Skip to content

Commit f73b409

Browse files
committed
fix: fix __dirname is not defined in es module
1 parent c5f5b45 commit f73b409

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/utils/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import path from 'node:path'
22
import fs from 'node:fs'
3+
import { fileURLToPath } from 'node:url'
34
import qrcodeTerminal from 'qrcode-terminal'
45
import jsqr from 'jsqr'
56
import UPNG from '@pdf-lib/upng'
67

8+
export const __dirname = path.dirname(fileURLToPath(import.meta.url))
9+
710
/**
811
* 将传入的路径组合起来形成一个完整的路径
912
* @param {...string} paths - 要组合的路径

0 commit comments

Comments
 (0)