import { Observable, of } from 'rxjs'; import { ResolvedPath } from './PageRouter'; import { pathToImport } from './paths'; import { NOT_FOUND_PATH, UNKNOWN_CHUNK } from './vars'; export function fileSystemResolver(pathname: string, pages: string[]): Observable { const m = pathToImport(pages, pathname); if (m && m.filepath) { return of({ pathname, pageName: m.filepath.raw, chunkName: m.chunkName || UNKNOWN_CHUNK, id: -1, }); } return of({ pathname, pageName: NOT_FOUND_PATH, chunkName: UNKNOWN_CHUNK, id: -1, }); }