Merge pull request #762 from sixiaolong1117/master

Supports PWA.
This commit is contained in:
Donkie
2026-01-06 00:19:14 +01:00
committed by GitHub
5 changed files with 3818 additions and 182 deletions

3930
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -53,7 +53,8 @@
"eslint-plugin-react-refresh": "^0.4.20", "eslint-plugin-react-refresh": "^0.4.20",
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vite": "^6.4.1", "vite": "^6.4.1",
"vite-plugin-mkcert": "^1.17.8" "vite-plugin-mkcert": "^1.17.8",
"vite-plugin-pwa": "^1.2.0"
}, },
"scripts": { "scripts": {
"dev": "refine dev", "dev": "refine dev",

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -1,22 +0,0 @@
{
"name": "Spoolman",
"short_name": "Spoolman",
"description": "Keep track of your inventory of 3D-printer filament spools.",
"icons": [
{
"purpose": "maskable",
"sizes": "512x512",
"src": "icon512_maskable.png",
"type": "image/png"
},
{
"purpose": "any",
"sizes": "512x512",
"src": "icon512_rounded.png",
"type": "image/png"
}
],
"background_color": "#1F1F1F",
"theme_color": "#DC7734",
"display": "standalone"
}

View File

@@ -1,8 +1,49 @@
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import { VitePWA } from 'vite-plugin-pwa';
import svgr from "vite-plugin-svgr"; import svgr from "vite-plugin-svgr";
export default defineConfig({ export default defineConfig({
base: "", base: "",
plugins: [react(), svgr()], plugins: [react(), svgr(),
}); VitePWA({
registerType: 'autoUpdate',
devOptions: {
enabled: true,
},
includeAssets: ['favicon.ico', 'favicon.svg', 'apple-touch-icon.png'],
manifest: {
name: "Spoolman",
short_name: "Spoolman",
description: "Keep track of your inventory of 3D-printer filament spools.",
"icons": [
{
"purpose": "maskable",
"sizes": "512x512",
"src": "icon512_maskable.png",
"type": "image/png"
},
{
"purpose": "any",
"sizes": "512x512",
"src": "icon512_rounded.png",
"type": "image/png"
},
{
"purpose": "any",
"sizes": "192x192",
"src": "icon192_rounded.png",
"type": "image/png"
}
],
background_color: "#1F1F1F",
theme_color: "#DC7734",
display: "standalone",
start_url: "/",
scope: "/"
},
workbox: {
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
}
})],
});