INNER CODE UNIT · TypeScript
resolveBuildMode
reactnativecn/react-native-update · harmony/hvigor-plugin.ts:53
export function resolveBuildMode(
node: HvigorNodeLike,
taskContext: HvigorTaskContext | undefined,
argv: string[],
): string {
if (taskContext && typeof taskContext.getBuildMode === 'function') {
return String(taskContext.getBuildMode());
}
if (typeof node.getContext === 'function') {
for (const pluginId of MODULE_PLUGIN_IDS) {
try {
const context = node.getContext(pluginId);
if (context && typeof context.getBuildMode === 'function') {
return String(context.getBuildMode());
}
} catch (e) {
// not this module type
}