UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

1 lines • 1.34 kB
{"version":3,"file":"createRoutesManifest.js","names":[],"sources":["esm/server/createRoutesManifest.js"],"sourcesContent":["import { getRoutes } from \"../router/getRoutes\";\nimport { getServerManifest } from \"./getServerManifest\";\nfunction createMockModuleWithContext(map = []) {\n const contextModule = (key) => ({ default() {\n } });\n Object.defineProperty(contextModule, \"keys\", {\n value: () => map\n });\n return contextModule;\n}\nfunction createRoutesManifest(paths, options) {\n const routeTree = getRoutes(createMockModuleWithContext(paths), {\n ...options,\n preserveApiRoutes: true,\n ignoreRequireErrors: true,\n ignoreEntryPoints: true,\n platform: \"web\"\n });\n if (!routeTree) {\n throw new Error(`No route tree found in paths: ${JSON.stringify(paths)}`);\n }\n return getServerManifest(routeTree);\n}\nexport {\n createRoutesManifest\n};\n//# sourceMappingURL=createRoutesManifest.js.map\n"],"mappings":";;;;AAEA,SAAS,4BAA4B,MAAM,CAAC,GAAG;CAC7C,MAAM,iBAAiB,SAAS,EAAE,UAAU,CAC5C,EAAE;CACF,OAAO,eAAe,eAAe,QAAQ,EAC3C,aAAa,IACf,CAAC;CACD,OAAO;AACT;AACA,SAAS,qBAAqB,OAAO,SAAS;CAC5C,MAAM,YAAY,UAAU,4BAA4B,KAAK,GAAG;EAC9D,GAAG;EACH,mBAAmB;EACnB,qBAAqB;EACrB,mBAAmB;EACnB,UAAU;CACZ,CAAC;CACD,IAAI,CAAC,WAAW;EACd,MAAM,IAAI,MAAM,iCAAiC,KAAK,UAAU,KAAK,GAAG;CAC1E;CACA,OAAO,kBAAkB,SAAS;AACpC"}