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
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
.
If you used the svelte-pwa cli this should be pretty straight forward and already set, if not:
- The
service-worker.js
andmanifest.json
files are in thepublic
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 thelogAppInstalled
function. Note: If you don't want to make the app installable you can remove the script from theindex.html
file in thepublic
folder.
For more info, this template was made following this tutorial
To create an optimised version of the app:
npm run build