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 pathOr you can use directly the following command:
npx degit jenaro94/routify-pwa-starter pathInstall the dependencies...
cd path
npm install
npm run devNavigate 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.
If you used the svelte-pwa cli this should be pretty straight forward and already set, if not:
- The
service-worker.jsandmanifest.jsonfiles are in thepublicfolder. - You should update the icons in
/public/images/icons - For an offline experience edit the
/public/offline.htmlfile. - This PWA is installable, the
/public/scripts/install.jsfile has the install configuration. You should change the app name in thelogAppInstalledfunction. Note: If you don't want to make the app installable you can remove the script from theindex.htmlfile in thepublicfolder.
For more info, this template was made following this tutorial
To create an optimised version of the app:
npm run build