INNER CODE UNIT · TypeScript
reactVersion
onejs/one · packages/compiler/src/index.ts:227
const reactVersion = await (async () => {
const path = resolvePath('react/package.json')
const json = JSON.parse(await readFile(path, 'utf-8'))
return json.version as string
})()
const envNames = {
ios: true,
android: true,
client: true,
ssr: true,
}
function getEnvName(name: string) {
if (!envNames[name]) throw new Error(`Invalid env: ${name}`)
return name as Environment
}