Doc addition. Any feedback welcome. Text starts below the line.
Migrating from svelte-template
Did you start your project using svelte-template but have decided you need a router? No worries. It's easy to transfer over your project to use Routify instead.
-
Copy over the dependencies and the npm tasks from package.json.
-
Copy over the full content from rollup.config.js
-
Put whatever static assets you had in the public folder into a new folder called static
-
Within your src folder, make sure the contents of App.svelte are the following:
<script>
import { Router } from "@sveltech/routify";
import { routes } from "@sveltech/routify/tmp/routes";
</script>
<Router {routes} />
- Within your src folder, create a folder called
pages
- Within
pages, create a file called index.svelte. This will correspond to /.
- Now run
npm i to install the necessary dependencies; and run npm run dev to run Routify's dev server.
Optional
If you are looking to deploy your project to Now or Netlify, look in the scripts folder and copy the files you need.
Doc addition. Any feedback welcome. Text starts below the line.
Migrating from svelte-template
Did you start your project using svelte-template but have decided you need a router? No worries. It's easy to transfer over your project to use Routify instead.
Copy over the dependencies and the npm tasks from package.json.
Copy over the full content from rollup.config.js
Put whatever static assets you had in the
publicfolder into a new folder calledstaticWithin your
srcfolder, make sure the contents of App.svelte are the following:pagespages, create a file calledindex.svelte. This will correspond to/.npm ito install the necessary dependencies; and runnpm run devto run Routify's dev server.Optional
If you are looking to deploy your project to Now or Netlify, look in the scripts folder and copy the files you need.