Skip to content

Doc addition: Migrating from other templates #132

Description

@Wolfr

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.

  1. Copy over the dependencies and the npm tasks from package.json.

  2. Copy over the full content from rollup.config.js

  3. Put whatever static assets you had in the public folder into a new folder called static

  4. 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} />
  1. Within your src folder, create a folder called pages
  2. Within pages, create a file called index.svelte. This will correspond to /.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions