INNER CODE UNIT · TypeScript
fromArgv
reactnativecn/react-native-update · harmony/hvigor-plugin.ts:75
const fromArgv = argv.find(arg => arg.startsWith('buildMode='));
return fromArgv ? fromArgv.substring('buildMode='.length) : 'debug';
}
// The plugin is meant for a module hvigorfile (entry/hvigorfile.ts). When it
// is applied from the project hvigorfile instead, the node path is the
// project root (AppScope lives there): fall back to entry/ like the original
// plugin did, so an existing setup keeps working.
export function resolveModuleDir(node: HvigorNodeLike, cwd: string): string {
const nodePath =
typeof node.getNodePath === 'function' ? node.getNodePath() : '';
if (!nodePath) {
return path.resolve(cwd, 'entry');
}
if (fs.existsSync(path.join(nodePath, 'AppScope', 'app.json5'))) {
console.warn(
'reactNativeUpdatePlugin: applied at project level; writing meta.json ' +
'into entry/. Apply it from the module hvigorfile instead.',