Skip to content

Commit 340ec41

Browse files
committed
chore: make build script node 18 compatible
1 parent 1c532a7 commit 340ec41

File tree

2 files changed

+55
-56
lines changed

2 files changed

+55
-56
lines changed

package-lock.json

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

scripts/referenceEventTypings.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import {copyFile, readdir, readFile, writeFile} from 'node:fs/promises'
2-
import {join as joinPath} from 'node:path'
2+
import {dirname, join as joinPath} from 'node:path'
3+
import {fileURLToPath} from 'node:url'
4+
5+
const rootDir = joinPath(dirname(fileURLToPath(import.meta.url)), '..')
6+
const distDir = joinPath(rootDir, 'dist')
7+
const srcDir = joinPath(rootDir, 'src')
38

49
const referenceDirective = `/// <reference path="events.d.ts" />`
510

@@ -16,9 +21,6 @@ const referenceDirective = `/// <reference path="events.d.ts" />`
1621
* directly, so we have to do this as a post-build step.
1722
*/
1823
async function referenceEventTypings() {
19-
const distDir = joinPath(import.meta.dirname, '..', 'dist')
20-
const srcDir = joinPath(import.meta.dirname, '..', 'src')
21-
2224
const entries = await readdir(distDir)
2325

2426
const typeEntries = entries.filter(

0 commit comments

Comments
 (0)