2025-06-06 20:48:05 +07:00
|
|
|
import { _uapi } from '@revenge-mod/plugins/_'
|
2025-06-02 15:50:29 +07:00
|
|
|
import { defineLazyProperty } from '@revenge-mod/utils/objects'
|
2025-06-06 20:48:05 +07:00
|
|
|
import type { UnscopedInitPluginApi } from '@revenge-mod/plugins/types'
|
|
|
|
|
import type { PluginApiExternals } from './types'
|
2025-06-02 15:50:29 +07:00
|
|
|
|
2025-06-06 20:48:05 +07:00
|
|
|
const uapi = _uapi as UnscopedInitPluginApi
|
|
|
|
|
const externals = (uapi.externals = {} as PluginApiExternals)
|
2025-06-02 15:50:29 +07:00
|
|
|
|
2025-06-09 19:32:33 +07:00
|
|
|
// ROLLDOWN ISSUE: Requires us to do () => { return require(...) } instead of () => require(...)
|
|
|
|
|
|
|
|
|
|
defineLazyProperty(externals, 'Browserify', () => {
|
2025-06-06 20:08:25 +07:00
|
|
|
return require('@revenge-mod/externals/browserify')
|
|
|
|
|
})
|
|
|
|
|
|
2025-06-09 19:32:33 +07:00
|
|
|
defineLazyProperty(externals, 'ReactNativeClipboard', () => {
|
2025-06-06 20:08:25 +07:00
|
|
|
return require('@revenge-mod/externals/react-native-clipboard')
|
|
|
|
|
})
|
|
|
|
|
|
2025-06-09 19:32:33 +07:00
|
|
|
defineLazyProperty(externals, 'ReactNavigation', () => {
|
2025-06-06 20:08:25 +07:00
|
|
|
return require('@revenge-mod/externals/react-navigation')
|
|
|
|
|
})
|
|
|
|
|
|
2025-06-09 19:32:33 +07:00
|
|
|
defineLazyProperty(externals, 'Shopify', () => {
|
2025-06-06 20:08:25 +07:00
|
|
|
return require('@revenge-mod/externals/shopify')
|
|
|
|
|
})
|