routify-pwa-starter

Routify Pwa Starter

A starter template for a svelte/routify pwa


Routify PWA

This is a Progressive Web App (PWA) template for Svelte apps with Routify. It is based on this starter.

To create a new project based on this template you can use the svelte-pwa-cli:

npm install -g svelte-pwa
svelte-pwa path

Or you can use directly the following command:

npx degit jenaro94/routify-pwa-starter path

Get started

Install the dependencies...

cd path
npm install
npm run dev

Navigate to localhost:5000. You should see your app running. Edit a component file in src, save it, and reload the page to see your changes. By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0.

PWA Configuration

If you used the svelte-pwa cli this should be pretty straight forward and already set, if not:

  • The service-worker.js and manifest.json files are in the public folder.
  • You should update the icons in /public/images/icons
  • For an offline experience edit the /public/offline.html file.
  • This PWA is installable, the /public/scripts/install.js file has the install configuration. You should change the app name in the logAppInstalled function. Note: If you don't want to make the app installable you can remove the script from the index.html file in the public folder.

For more info, this template was made following this tutorial

Building and running in production mode

To create an optimised version of the app:

npm run build

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes