mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-26 11:36:41 +08:00
14 lines
359 B
JavaScript
14 lines
359 B
JavaScript
import { join } from 'path';
|
|
import { existsSync } from 'fs';
|
|
import winPath from './winPath';
|
|
|
|
export default function getAppPath(absSrcPath) {
|
|
for (const suffix of ['.js', '.ts', '.jsm', '.jsx', '.tsx']) {
|
|
const p = winPath(join(absSrcPath, `app${suffix}`));
|
|
if (existsSync(p)) {
|
|
return p;
|
|
}
|
|
}
|
|
return null;
|
|
}
|