Add PWA support

This commit is contained in:
momo5502
2025-09-06 19:40:40 +02:00
parent 289eb2cbb0
commit 517270e2cf
3 changed files with 4152 additions and 75 deletions

4203
page/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "emulator-ui",
"name": "sogen",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
@@ -60,6 +60,7 @@
"prettier": "3.6.2",
"typescript": "~5.8.3",
"typescript-eslint": "^8.41.0",
"vite": "^7.1.4"
"vite": "^7.1.4",
"vite-plugin-pwa": "^1.0.3"
}
}

View File

@@ -1,11 +1,26 @@
import path from "path";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
import react from "@vitejs/plugin-react";
const mb = 1024 ** 2;
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
plugins: [
react(),
tailwindcss(),
VitePWA({
registerType: "autoUpdate",
manifest: {
theme_color: "#0279E8",
},
workbox: {
maximumFileSizeToCacheInBytes: 100 * mb,
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),