MCPcopy Create free account
hub / github.com/remix-run/react-router / getRouteModuleExports

Function getRouteModuleExports

packages/react-router-dev/vite/plugin.ts:551–569  ·  view source on GitHub ↗
(
  viteChildCompiler: Vite.ViteDevServer | null,
  ctx: ReactRouterPluginContext,
  routeFile: string,
  readRouteFile?: () => string | Promise<string>,
)

Source from the content-addressed store, hash-verified

549};
550
551const getRouteModuleExports = async (
552 viteChildCompiler: Vite.ViteDevServer | null,
553 ctx: ReactRouterPluginContext,
554 routeFile: string,
555 readRouteFile?: () => string | Promise<string>,
556): Promise<string[]> => {
557 if (!viteChildCompiler) {
558 throw new Error("Vite child compiler not found");
559 }
560
561 let code = await compileRouteFile(
562 viteChildCompiler,
563 ctx,
564 routeFile,
565 readRouteFile,
566 );
567
568 return getExportNames(code);
569};
570
571let getServerBuildDirectory = (
572 reactRouterConfig: ResolvedReactRouterConfig,

Callers 3

transformFunction · 0.85
getRouteMetadataFunction · 0.85

Calls 2

compileRouteFileFunction · 0.85
getExportNamesFunction · 0.85

Tested by

no test coverage detected