From fa418eef1614c9304f94521e7dc027b2a969a8a2 Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Wed, 14 Jun 2023 23:41:57 +0200 Subject: [PATCH] Update develop.md sw docs turns out http://localhost runs service workers just fine on all desktop browsers :shrug: --- docs/develop.md | 31 +------------------------------ web/vite.config.js | 10 +--------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/docs/develop.md b/docs/develop.md index 49ed8dbc..be6795f6 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -267,37 +267,8 @@ Reference: Note: On Firefox, for testing you can run service workers over HTTP (insecurely); simply check the Enable Service Workers over HTTP (when toolbox is open) option in the Firefox Devtools options/gear menu - - - Safari, iOS: - - There doesn't seem to be a good way to do this currently. The only way is to serve a valid HTTPS certificate. - - This is beyond the scope of this guide, but you can try `mkcert`, a number of reverse proxies such as Traefik and Caddy, - or tunneling software such as [Cloudflare Tunnels][cloudflare_tunnels] or ngrok. - -[cloudflare_tunnels]: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/do-more-with-tunnels/trycloudflare/ - -6. Open #### With a built package 1. Run `make web-build` diff --git a/web/vite.config.js b/web/vite.config.js index 840ee006..4089b032 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -3,13 +3,6 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { VitePWA } from "vite-plugin-pwa"; -// please look at develop.md for how to run your browser -// in a mode allowing insecure service worker testing -// this turns on: -// - the service worker in dev mode -// - turns off automatically opening the browser -const enableLocalPWATesting = process.env.ENABLE_DEV_PWA; - export default defineConfig(() => ({ build: { outDir: "build", @@ -18,7 +11,6 @@ export default defineConfig(() => ({ }, server: { port: 3000, - open: !enableLocalPWATesting, }, plugins: [ react(), @@ -27,7 +19,7 @@ export default defineConfig(() => ({ injectRegister: "inline", strategies: "injectManifest", devOptions: { - enabled: enableLocalPWATesting, + enabled: true, /* when using generateSW the PWA plugin will switch to classic */ type: "module", navigateFallback: "index.html",