one
Version:
One is a new React Framework that makes Vite serve both native and web.
32 lines (31 loc) • 939 B
JavaScript
import { getRoutes } from "../router/getRoutes.native.js";
import { getServerManifest } from "./getServerManifest.native.js";
function createMockModuleWithContext() {
var map = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
var contextModule = function (key) {
return {
default() {}
};
};
Object.defineProperty(contextModule, "keys", {
value: function () {
return map;
}
});
return contextModule;
}
function createRoutesManifest(paths, options) {
var routeTree = getRoutes(createMockModuleWithContext(paths), {
...options,
preserveApiRoutes: true,
ignoreRequireErrors: true,
ignoreEntryPoints: true,
platform: "web"
});
if (!routeTree) {
throw new Error(`No route tree found in paths: ${JSON.stringify(paths)}`);
}
return getServerManifest(routeTree);
}
export { createRoutesManifest };
//# sourceMappingURL=createRoutesManifest.native.js.map