Skip to content

Commit c8e6687

Browse files
chore: wip
1 parent b883eb2 commit c8e6687

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/bun-query-builder/build.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { readFile, writeFile } from 'node:fs/promises'
12
import { dts } from 'bun-plugin-dtsx'
2-
import { readFile, writeFile } from 'fs/promises'
33

44
await Bun.build({
55
entrypoints: ['src/index.ts'],
@@ -15,9 +15,10 @@ const content = await readFile(filePath, 'utf8')
1515

1616
// Replace init_config(); with await init_config(); only in the init_src function body
1717
const updatedContent = content.replace(
18-
/(var init_src = __esm\(async \(\) => \{[\s\S]*?)(\s+)(init_config\(\);)/,
19-
'$1$2await init_config();'
18+
// eslint-disable-next-line regexp/no-super-linear-backtracking
19+
/(var init_src = __esm\(async \(\) => \{)((?:(?!\s+init_config\(\);)[\s\S])*?)(\s+)(init_config\(\);)/,
20+
'$1$2$3await $4',
2021
)
2122

2223
await writeFile(filePath, updatedContent)
23-
console.log('Fixed async init_config() call in build output')
24+
console.log('Fixed async init_config() call in build output')

0 commit comments

Comments
 (0)