Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<NuxtLayout>
<NuxtPwaManifest />
<NuxtPage />
<div class="absolute flex gap-2" style="top: 20px; right: 20px">
<ThemeSwitcher />
Expand Down
64 changes: 62 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-11-01",
modules: ["@nuxtjs/tailwindcss", "@nuxtjs/i18n", "@nuxt/icon"],
modules: [
"@nuxtjs/tailwindcss",
"@nuxtjs/i18n",
"@nuxt/icon",
"@vite-pwa/nuxt",
],
devtools: { enabled: true },
app: {
head: {
Expand Down Expand Up @@ -58,7 +63,62 @@ export default defineNuxtConfig({
},
nitro: {
prerender: {
routes: [ "/" ],
autoSubfolderIndex: false,
},
},
});
pwa: {
enabled: true,
strategies: 'generateSW',
registerType: 'autoUpdate',
manifest: {
name: 'LocalSend Web',
short_name: 'LocalSend',
theme_color: '#111827',
background_color: '#111827',
scope: "/",
id: "localsend",
start_url: "/?pwa=1",
icons: [
{
src: 'apple-touch-icon.png',
sizes: '180x180',
type: 'image/png',
},
{
src: 'logo-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
},
workbox: {
globPatterns: [
'/',
'**/*.{js,css,html,png,svg,ico}',
],
navigateFallback: '/',
runtimeCaching: [{
urlPattern: /^https:\/\/api\.iconify\.design\/.*'/i,
handler: "CacheFirst",
options: {
cacheName: "icons",
expiration: {
maxEntries: 10,
},
}
}],
},
client: {
installPrompt: true,
},
devOptions: {
enabled: true,
suppressWarnings: true,
navigateFallback: '/',
navigateFallbackAllowlist: [/^\/$/],
type: 'module',
},
}
});
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@vite-pwa/nuxt": "1.0.4",
"@vueuse/core": "^12.5.0",
"@vueuse/nuxt": "^12.5.0",
"nuxt": "^3.15.2",
Expand All @@ -27,5 +28,10 @@
"prettier": "3.4.2",
"tailwindcss": "^3.4.17",
"vitest": "^3.0.4"
},
"pnpm": {
"overrides": {
"@intlify/message-compiler": "^11.1.2"
}
}
}
Loading