Skip to content

Commit

Permalink
feat(vxrn): add REACT_NATIVE_VERSION env automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
natew committed Jan 25, 2025
1 parent 2a86005 commit 4d17794
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vxrn/src/utils/getBaseViteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export async function getBaseViteConfig(
)
).find((x) => typeof x === 'string')

const reactNativePackageJsonPath = resolvePath('react-native/package.json', root)
const { version } = await FSExtra.readJSON(reactNativePackageJsonPath)

return {
mode,

Expand Down Expand Up @@ -103,6 +106,7 @@ export async function getBaseViteConfig(
define: {
__DEV__: `${mode === 'development'}`,
'process.env.NODE_ENV': `"${mode}"`,
'process.env.REACT_NATIVE_VERSION': `"${version}"`,
},

resolve: {
Expand Down

0 comments on commit 4d17794

Please sign in to comment.