MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / lazyModuleFile

Function lazyModuleFile

src/resolution/frameworks/react.ts:479–483  ·  view source on GitHub ↗

* The file a lazily loaded module is, from the file that loads it: by the * extensions that file's own imports resolve with (`./MainLayout` is * `MainLayout/index.jsx` from a `.jsx` file), else by TypeScript's.

(spec: string, fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

477 * `MainLayout/index.jsx` from a `.jsx` file), else by TypeScript's.
478 */
479function lazyModuleFile(spec: string, fromFile: string, context: ResolutionContext): string | null {
480 const language = scriptLanguage(fromFile);
481 return resolveImportPath(spec, fromFile, language, context) ??
482 (language === 'typescript' ? null : resolveImportPath(spec, fromFile, 'typescript', context));
483}
484
485/** The component a lazy route module renders: its default export, else its `Component` export. */
486function lazyRouteComponent(spec: string, fromFile: string, context: ResolutionContext, reads?: Set<string>): string | null {

Callers 2

lazyRouteComponentFunction · 0.85
pickedExportFunction · 0.85

Calls 2

resolveImportPathFunction · 0.90
scriptLanguageFunction · 0.85

Tested by

no test coverage detected