Skip to content

Commit e95d42b

Browse files
committed
Add PWA support
1 parent 8465ca5 commit e95d42b

3 files changed

Lines changed: 13881 additions & 10180 deletions

File tree

nuxt.config.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,58 @@ export default defineNuxtConfig({
88
'@pinia/nuxt',
99
'pinia-plugin-persistedstate/nuxt',
1010
'shadcn-nuxt',
11+
'@vite-pwa/nuxt',
1112
],
1213

14+
pwa: {
15+
registerType: 'autoUpdate',
16+
manifest: {
17+
name: 'Showcode',
18+
short_name: 'Showcode',
19+
description: 'Create beautiful images of code.',
20+
theme_color: '#09090b',
21+
background_color: '#09090b',
22+
display: 'standalone',
23+
icons: [
24+
{
25+
src: '/android-chrome-192x192.png',
26+
sizes: '192x192',
27+
type: 'image/png',
28+
},
29+
{
30+
src: '/android-chrome-512x512.png',
31+
sizes: '512x512',
32+
type: 'image/png',
33+
},
34+
{
35+
src: '/android-chrome-512x512.png',
36+
sizes: '512x512',
37+
type: 'image/png',
38+
purpose: 'maskable',
39+
},
40+
],
41+
},
42+
workbox: {
43+
navigateFallback: '/',
44+
globPatterns: ['**/*.{js,css,html,png,svg,ico,woff2}'],
45+
globIgnores: ['**/*.worker-*.js'],
46+
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
47+
runtimeCaching: [
48+
{
49+
urlPattern: /\.worker.*\.js$/,
50+
handler: 'CacheFirst',
51+
options: {
52+
cacheName: 'worker-cache',
53+
expiration: { maxEntries: 10, maxAgeSeconds: 60 * 60 * 24 * 30 },
54+
},
55+
},
56+
],
57+
},
58+
devOptions: {
59+
enabled: false,
60+
},
61+
},
62+
1363
shadcn: {
1464
prefix: '',
1565
componentDir: './app/components/ui',

0 commit comments

Comments
 (0)