guide
Installation
Manual Installation
Routify can be added to any project, but we do recommend trying to the Vite powered starter repo first.
1. Install
We’re using npm
, but you can use your favorite package manager.
npm install @roxi/routify@next
2a. Using Vite
If you’re using Vite, you can add Routify by updating your Vite config:
import routify from '@roxi/routify/vite-plugin'
export default defineConfig({
plugins: [
routify({/* config */})
2b. Without Vite
If you’re not using Vite, you can Run Routify by adding the following scripts to your package.json:
"watch": "routify -w",
"build": "routify"
Running the watch command will let Routify watch your file structure for routes (src/routes
by default) and rebuild routes as it changes.
3. Integrate Routify
Finally, to add Routify to your app, open a Svelte file (eg. App.svelte
) and add the following.
<script context="module">
import { Router, createRouter } from '@roxi/routify'
import routes from '../.routify/routes.default.js'
export const router = createRouter({ routes })
</script>
<Router {router} />