{"id":16225163,"url":"https://github.com/6edesign/svelte-router","last_synced_at":"2025-04-08T03:30:00.466Z","repository":{"id":57093793,"uuid":"167663378","full_name":"6eDesign/svelte-router","owner":"6eDesign","description":"A svelte router with code splitting","archived":false,"fork":false,"pushed_at":"2020-07-13T22:04:48.000Z","size":562,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-14T05:45:59.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/6eDesign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-26T07:44:19.000Z","updated_at":"2021-06-17T09:10:06.000Z","dependencies_parsed_at":"2022-08-22T21:40:33.024Z","dependency_job_id":null,"html_url":"https://github.com/6eDesign/svelte-router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6eDesign%2Fsvelte-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6eDesign%2Fsvelte-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6eDesign%2Fsvelte-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/6eDesign%2Fsvelte-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/6eDesign","download_url":"https://codeload.github.com/6eDesign/svelte-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247770388,"owners_count":20993176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T12:44:18.291Z","updated_at":"2025-04-08T03:30:00.403Z","avatar_url":"https://github.com/6eDesign.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-router\nA little router component that uses code splitting for components. Uses page.js (~2kb min/gzip) for routing. \n\n## A Work in Progress: \nI'm not entirely sure this is useful yet and it has not been published to NPM at this time. \n\n## How to use: \nWith Svelte v3: \n\n```html\n\u003cscript\u003e\n import { Router, Route } from '6edesign/svelte-router';\n\u003c/script\u003e\n\n\u003cdiv\u003e\n  \u003cRouter\u003e\n    \u003c!-- Route paths can be strings (exact matches or express-style named-params) or regex --\u003e\n    \u003c!-- componentImport is a function which dynamically imports the necessary component --\u003e\n    \u003cRoute \n      path='/' \n      componentImport={() =\u003e import('./HomeRoute.svelte')} \n    /\u003e\n    \u003cRoute \n      path={/\\/regex-route\\.(\\d+)/} \n      componentImport={() =\u003e import('./RegexRoute.svelte')} \n    /\u003e\n    \u003cRoute \n      path='/named/:id'\n      componentImport={() =\u003e import('./NamedParamsRoute.svelte')} \n    /\u003e\n \u003c/Router\u003e\n\u003c/div\u003e\n```\n\n(Minimal) Rollup Config Example: \n```js\nimport svelte from \"rollup-plugin-svelte\";\nimport resolve from \"rollup-plugin-node-resolve\";\nimport commonjs from \"rollup-plugin-commonjs\";\nimport { terser } from \"rollup-plugin-terser\";\n\nconst test = {\n  input: \"src/app.js\",\n  output: {\n    sourcemap: true,\n    format: \"es\",\n    dir: 'public/module'\n  },\n  experimentalCodeSplitting: true, \n  plugins: [\n    svelte({\n      nestedTransitions: true,\n      dev: false,\n      css: css =\u003e {\n        css.write(\"public/app.css\");\n      }\n    }),\n    resolve(),\n    commonjs()\n  ]\n};\n\nexport default [test];\n\n```\n\n## Contributing to this project\n\nClone \u0026 install the dependencies...\n\n```bash\ncd svelte-router\nnpm install\n```\n\n...then start [Rollup](https://rollupjs.org):\n\n```bash\nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F6edesign%2Fsvelte-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F6edesign%2Fsvelte-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F6edesign%2Fsvelte-router/lists"}