Hello {name}!
This is a starter template for a Svelte PWA, based in the Svelte template
You will find the manifest.json file and the service-worker.js file in the public folder
To update the proper icons for the PWA check /public/images/icons
Repository: tretapey/svelte-pwa Branch: master Commit: 6958525b5ba8 Files: 11 Total size: 9.8 KB Directory structure: gitextract_gmx67wy7/ ├── .gitignore ├── README.md ├── package.json ├── public/ │ ├── global.css │ ├── index.html │ ├── manifest.json │ ├── offline.html │ └── service-worker.js ├── rollup.config.js └── src/ ├── App.svelte └── main.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ /node_modules/ /public/build/ .DS_Store ================================================ FILE: README.md ================================================ --- # Svelte PWA This is a Progressive Web App (PWA) template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/tretapey/svelte-pwa. To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit): ```bash npx degit tretapey/svelte-pwa my-svelte-pwa cd my-svelte-pwa ``` _Note that you will need to have [Node.js](https://nodejs.org) installed._ ## Get started Install the dependencies... ```bash cd my-svelte-pwa npm install ``` ...then start [Rollup](https://rollupjs.org): ```bash npm run dev ``` Navigate to [localhost:5000](http://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 - 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. For more information on how to use check [this repo](https://github.com/pwa-builder/pwa-install). 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](https://codelabs.developers.google.com/codelabs/your-first-pwapp) ## Building and running in production mode To create an optimised version of the app: ```bash npm run build ``` ================================================ FILE: package.json ================================================ { "name": "svelte-pwa-template", "version": "1.0.4", "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public", "test": "echo test" }, "devDependencies": { "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-node-resolve": "^7.0.0", "rollup": "^1.20.0", "rollup-plugin-livereload": "^1.0.0", "rollup-plugin-svelte": "^6.1.1", "rollup-plugin-terser": "^7.0.1", "svelte": "^3.49.0" }, "dependencies": { "sirv-cli": "^0.4.4" } } ================================================ FILE: public/global.css ================================================ html, body { position: relative; width: 100%; height: 100%; } body { color: #333; margin: 0; padding: 8px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } a { color: rgb(0,100,200); text-decoration: none; } a:hover { text-decoration: underline; } a:visited { color: rgb(0,80,160); } label { display: block; } input, button, select, textarea { font-family: inherit; font-size: inherit; padding: 0.4em; margin: 0 0 0.5em 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 2px; } input:disabled { color: #ccc; } input[type="range"] { height: 0; } button { color: #333; background-color: #f4f4f4; outline: none; } button:disabled { color: #999; } button:not(:disabled):active { background-color: #ddd; } button:focus { border-color: #666; } ================================================ FILE: public/index.html ================================================
This is a starter template for a Svelte PWA, based in the Svelte template
You will find the manifest.json file and the service-worker.js file in the public folder
To update the proper icons for the PWA check /public/images/icons