Skip to content

Commit

Permalink
fix: pwa 3, pls work
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 17, 2022
1 parent 582c3e9 commit d06ac52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"homepage": "https://github.com/Leomotors/anime-captcha",
"scripts": {
"pre-build": "pnpm lm-config && node prebuild.js",
"dev": "pnpm lm-inc && pnpm pre-build && vite dev --port 6912",
"dev": "pnpm pre-build && vite dev --port 6912",
"build": "pnpm pre-build && vite build && sh post-build.sh",
"package": "svelte-kit package",
"preview": "vite preview",
Expand Down
11 changes: 11 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
<script lang="ts">
import "../app.scss";
import { onMount } from "svelte";
import { dev } from "$app/environment";
import { page } from "$app/stores";
import GitHub from "$icons/GitHub.svelte";
import ext from "$lib/ext";
import { elapsedFrom } from "$lib/time";
import { BuildTime, Version } from "../config.g";
onMount(() => {
if (dev) return;
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("./sw.js", { scope: "./" });
}
});
</script>

<svelte:head>
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineConfig({
plugins: [
sveltekit(),
VitePWA({
injectRegister: "script",
injectRegister: null,
registerType: "autoUpdate",
manifest: {
name: "Anime Captcha",
Expand Down

1 comment on commit d06ac52

@vercel
Copy link

@vercel vercel bot commented on d06ac52 Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anime-captcha – ./

anime-captcha-leomotors.vercel.app
anime-captcha-git-main-leomotors.vercel.app
anime-captcha.vercel.app

Please sign in to comment.