diff --git a/build-config.ts b/build-config.ts index 508e5d0..d731461 100644 --- a/build-config.ts +++ b/build-config.ts @@ -3,9 +3,11 @@ import { BunBuildUserscriptConfig } from 'bun-build-userscript'; const define: Record = {}; -const raw = (await readFile('index.ts', 'utf8')).match(/declare const.+?;/s)[0]; +const raw = (await readFile('index.ts', 'utf8')).match( + /declare const[^;]+?;/ +)[0]; -const pattern = /(\S+): (\S+)[,;]/g; +const pattern = /(\S+):\s*([^,;]+)/g; let tmp; while ((tmp = pattern.exec(raw))) define[tmp[1]] = tmp[2];