INNER CODE UNIT · TypeScript
resolveModuleDir
reactnativecn/react-native-update · harmony/hvigor-plugin.ts:83
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.',
);
return path.join(nodePath, 'entry');
}
return nodePath;
}
export function resolveProjectDir(
node: HvigorNodeLike,