chore: update build flags

This commit is contained in:
PalmDevs 2025-05-05 19:13:05 +07:00
parent 125a803824
commit b85b2257e4
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
4 changed files with 4 additions and 3 deletions

View file

@ -10,7 +10,7 @@ import { logger } from './shared'
onModuleFirstRequired(0, function onceIndexRequired() {
runCatching(() => {
if (!__BUILD_FLAG_INIT_DISABLE_PATCH_LOG_PROMISE_REJECTIONS__) require('./patches/log-promise-rejections')
if (__BUILD_FLAG_LOG_PROMISE_REJECTIONS__) require('./patches/log-promise-rejections')
// Initialize preinit libraries
require('@revenge-mod/modules/preinit')

View file

@ -31,7 +31,7 @@ export default async function build(dev = false, log = true) {
__BUILD_COMMIT__: JSON.stringify((await $`git rev-parse HEAD`.text()).trim().substring(0, 7)),
__BUILD_BRANCH__: JSON.stringify((await $`git rev-parse --abbrev-ref HEAD`.text()).trim()),
__BUILD_ENV__: JSON.stringify(dev ? 'development' : 'production'),
__BUILD_FLAG_INIT_DISABLE_PATCH_LOG_PROMISE_REJECTIONS__: String(!dev),
__BUILD_FLAG_LOG_PROMISE_REJECTIONS__: String(dev),
},
plugins: [
swcPlugin(),

View file

@ -1,5 +1,6 @@
import { ReactJsxRuntime } from '@revenge-mod/react'
import { getProxyTarget, isProxy } from '@revenge-mod/utils/proxy'
import type { ElementType } from 'react'
const { jsx: _jsx, jsxs: _jsxs, Fragment } = ReactJsxRuntime

2
types.d.ts vendored
View file

@ -6,7 +6,7 @@ declare global {
const __BUILD_BRANCH__: string
const __BUILD_VERSION__: string
const __BUILD_FLAG_INIT_DISABLE_PATCH_LOG_PROMISE_REJECTIONS__: boolean
const __BUILD_FLAG_LOG_PROMISE_REJECTIONS__: boolean
}
export {}