UNPKG

@tanstack/router-plugin

Version:

Modern and scalable routing for React applications

1 lines 1.81 kB
{"version":3,"file":"framework-options.cjs","names":[],"sources":["../../../../src/core/code-splitter/framework-options.ts"],"sourcesContent":["type FrameworkOptions = {\n package: string\n idents: {\n createFileRoute: string\n lazyFn: string\n lazyRouteComponent: string\n }\n}\n\nexport function getFrameworkOptions(framework: string): FrameworkOptions {\n let frameworkOptions: FrameworkOptions\n\n switch (framework) {\n case 'react':\n frameworkOptions = {\n package: '@tanstack/react-router',\n idents: {\n createFileRoute: 'createFileRoute',\n lazyFn: 'lazyFn',\n lazyRouteComponent: 'lazyRouteComponent',\n },\n }\n break\n case 'solid':\n frameworkOptions = {\n package: '@tanstack/solid-router',\n idents: {\n createFileRoute: 'createFileRoute',\n lazyFn: 'lazyFn',\n lazyRouteComponent: 'lazyRouteComponent',\n },\n }\n break\n case 'vue':\n frameworkOptions = {\n package: '@tanstack/vue-router',\n idents: {\n createFileRoute: 'createFileRoute',\n lazyFn: 'lazyFn',\n lazyRouteComponent: 'lazyRouteComponent',\n },\n }\n break\n default:\n throw new Error(\n `[getFrameworkOptions] - Unsupported framework: ${framework}`,\n )\n }\n\n return frameworkOptions\n}\n"],"mappings":";AASA,SAAgB,oBAAoB,WAAqC;CACvE,IAAI;AAEJ,SAAQ,WAAR;EACE,KAAK;AACH,sBAAmB;IACjB,SAAS;IACT,QAAQ;KACN,iBAAiB;KACjB,QAAQ;KACR,oBAAoB;KACrB;IACF;AACD;EACF,KAAK;AACH,sBAAmB;IACjB,SAAS;IACT,QAAQ;KACN,iBAAiB;KACjB,QAAQ;KACR,oBAAoB;KACrB;IACF;AACD;EACF,KAAK;AACH,sBAAmB;IACjB,SAAS;IACT,QAAQ;KACN,iBAAiB;KACjB,QAAQ;KACR,oBAAoB;KACrB;IACF;AACD;EACF,QACE,OAAM,IAAI,MACR,kDAAkD,YACnD;;AAGL,QAAO"}