We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca5f810 commit 1784ac5Copy full SHA for 1784ac5
1 file changed
src/generator.ts
@@ -2,9 +2,14 @@ import satori from 'satori'
2
import { Resvg } from '@resvg/resvg-js'
3
import * as fs from 'fs'
4
import * as path from 'path'
5
+import { fileURLToPath } from 'url'
6
import { SocialPreviewTemplate } from './template.js'
7
import type { RepoData } from './github.js'
8
9
+// ESM equivalent of __dirname
10
+const __filename = fileURLToPath(import.meta.url)
11
+const __dirname = path.dirname(__filename)
12
+
13
const IMAGE_WIDTH = 1280
14
const IMAGE_HEIGHT = 640
15
0 commit comments