chore(lib/externals): refactor
This commit is contained in:
parent
5587ede6ba
commit
9e857d7751
5 changed files with 4 additions and 34 deletions
3
lib/externals/package.json
vendored
3
lib/externals/package.json
vendored
|
|
@ -3,9 +3,6 @@
|
|||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"default": "./src/index.ts"
|
||||
},
|
||||
"./browserify": {
|
||||
"default": "./src/browserify.ts"
|
||||
},
|
||||
|
|
|
|||
8
lib/externals/src/browserify.ts
vendored
8
lib/externals/src/browserify.ts
vendored
|
|
@ -11,13 +11,7 @@ export let nodeUtil: typeof import('node:util') = proxify(
|
|||
},
|
||||
)
|
||||
|
||||
if (module) {
|
||||
// This allows the Proxy instance to be garbage collected
|
||||
// after the module is initialized.
|
||||
nodeUtil = module
|
||||
gc()
|
||||
return module
|
||||
}
|
||||
if (module) return (nodeUtil = module)
|
||||
},
|
||||
{
|
||||
hint: 'object',
|
||||
|
|
|
|||
3
lib/externals/src/index.ts
vendored
3
lib/externals/src/index.ts
vendored
|
|
@ -1,3 +0,0 @@
|
|||
export * as browserify from './browserify'
|
||||
export * as reactNavigation from './react-navigation'
|
||||
export * as shopify from './shopify'
|
||||
16
lib/externals/src/react-navigation.ts
vendored
16
lib/externals/src/react-navigation.ts
vendored
|
|
@ -17,13 +17,7 @@ export let ReactNavigationNative: typeof import('@react-navigation/native') = pr
|
|||
},
|
||||
)
|
||||
|
||||
if (module) {
|
||||
// This allows the Proxy instance to be garbage collected
|
||||
// after the module is initialized.
|
||||
ReactNavigationNative = module
|
||||
gc()
|
||||
return module
|
||||
}
|
||||
if (module) return (ReactNavigationNative = module)
|
||||
},
|
||||
{
|
||||
hint: 'object',
|
||||
|
|
@ -42,13 +36,7 @@ export let ReactNavigationStack: typeof import('@react-navigation/stack') = prox
|
|||
},
|
||||
)
|
||||
|
||||
if (module) {
|
||||
// This allows the Proxy instance to be garbage collected
|
||||
// after the module is initialized.
|
||||
ReactNavigationStack = module
|
||||
gc()
|
||||
return module
|
||||
}
|
||||
if (module) return (ReactNavigationStack = module)
|
||||
},
|
||||
{
|
||||
hint: 'object',
|
||||
|
|
|
|||
8
lib/externals/src/shopify.ts
vendored
8
lib/externals/src/shopify.ts
vendored
|
|
@ -19,13 +19,7 @@ export let FlashList: typeof import('@shopify/flash-list') = proxify(
|
|||
},
|
||||
)
|
||||
|
||||
if (module) {
|
||||
// This allows the Proxy instance to be garbage collected
|
||||
// after the module is initialized.
|
||||
FlashList = module
|
||||
gc()
|
||||
return module
|
||||
}
|
||||
if (module) return (FlashList = module)
|
||||
},
|
||||
{
|
||||
hint: 'object',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue