Skip to content

Commit

Permalink
feat(vxrn): add end point for Expo development builds
Browse files Browse the repository at this point in the history
  • Loading branch information
zetavg authored and natew committed Aug 25, 2024
1 parent e182b69 commit 5aebb69
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions packages/vxrn/src/exports/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,25 @@ export const dev = async (optionsIn: VXRNOptions & { clean?: boolean }) => {
)

// builds the dev initial bundle for react native
const rnBundleHandler = defineEventHandler(async (e) => {
try {
const bundle = await getReactNativeBundle(options, viteRNClientPlugin)
return new Response(bundle, {
headers: {
'content-type': 'text/javascript',
},
})
} catch (err) {
console.error(` Error building React Native bundle: ${err}`)
}
})
router.get(
'/index.bundle',
defineEventHandler(async (e) => {
try {
const bundle = await getReactNativeBundle(options, viteRNClientPlugin)
return new Response(bundle, {
headers: {
'content-type': 'text/javascript',
},
})
} catch (err) {
console.error(` Error building React Native bundle: ${err}`)
}
})
rnBundleHandler
)
router.get(
'/.expo/.virtual-metro-entry.bundle', // for Expo development builds
rnBundleHandler
)

router.get(
Expand Down

0 comments on commit 5aebb69

Please sign in to comment.