feat: add PWA support

This commit is contained in:
kunish 2023-09-01 17:08:00 +08:00
parent 597c25fa74
commit a8c9c21898
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
3 changed files with 2672 additions and 1 deletions

View File

@ -49,6 +49,7 @@
"typescript": "^5.2.2", "typescript": "^5.2.2",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"vite": "^4.4.9", "vite": "^4.4.9",
"vite-plugin-pwa": "^0.16.4",
"vite-plugin-solid": "^2.7.0", "vite-plugin-solid": "^2.7.0",
"zod": "^3.22.2" "zod": "^3.22.2"
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,14 @@
import { defineConfig, splitVendorChunkPlugin } from 'vite' import { defineConfig, splitVendorChunkPlugin } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import solidPlugin from 'vite-plugin-solid' import solidPlugin from 'vite-plugin-solid'
export default defineConfig({ export default defineConfig({
base: './', base: './',
build: { chunkSizeWarningLimit: 1000 }, build: { chunkSizeWarningLimit: 1000 },
resolve: { alias: { '~': '/src' } }, resolve: { alias: { '~': '/src' } },
plugins: [solidPlugin(), splitVendorChunkPlugin()], plugins: [
solidPlugin(),
splitVendorChunkPlugin(),
VitePWA({ registerType: 'autoUpdate' }),
],
}) })