mirror of
https://github.com/brufdev/many-notes.git
synced 2026-05-07 10:19:26 -05:00
Add Vite PWA plugin
This commit is contained in:
Generated
+4483
-30
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -15,7 +15,8 @@
|
||||
"laravel-vite-plugin": "^2.0.1",
|
||||
"pusher-js": "^8.4.0",
|
||||
"tailwindcss": "^4.1.5",
|
||||
"vite": "^7.1.11"
|
||||
"vite": "^7.1.11",
|
||||
"vite-plugin-pwa": "^1.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@guyplusplus/turndown-plugin-gfm": "^1.0.7",
|
||||
|
||||
@@ -24,15 +24,14 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content">
|
||||
<meta name="apple-mobile-web-app-title" content="Many Notes">
|
||||
<title>{{ $title ?? 'Many Notes' }}</title>
|
||||
<link rel="icon" type="image/png" href="/assets/icon-16x16.png" sizes="16x16">
|
||||
<link rel="icon" type="image/png" href="/assets/icon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/svg+xml" href="/assets/icon.svg" sizes="any">
|
||||
<link rel="icon" type="image/png" href="/assets/icon-16x16.png" sizes="16x16">
|
||||
<link rel="shortcut icon" href="/assets/favicon.ico">
|
||||
<link rel="icon" type="image/svg+xml" href="/assets/icon.svg">
|
||||
<link rel="apple-touch-icon" href="/assets/icon-180x180.png" sizes="180x180">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="manifest" href="/build/manifest.webmanifest">
|
||||
|
||||
@vite('resources/css/app.css')
|
||||
@vite('resources/js/app.js')
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
|
||||
<body class="bg-light-base-100 dark:bg-base-800 text-light-base-950 dark:text-base-50">
|
||||
@@ -41,13 +40,7 @@
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js')
|
||||
.then(registration => {
|
||||
// Success
|
||||
})
|
||||
.catch(registrationError => {
|
||||
// Failure
|
||||
});
|
||||
navigator.serviceWorker.register('/build/sw.js');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
@@ -9,5 +10,39 @@ export default defineConfig({
|
||||
refresh: true,
|
||||
}),
|
||||
tailwindcss(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
includeAssets: [
|
||||
'robots.txt',
|
||||
'assets/*',
|
||||
],
|
||||
manifest: {
|
||||
name: "Many Notes",
|
||||
short_name: "ManyNotes",
|
||||
description: "Markdown note-taking web application designed for simplicity.",
|
||||
start_url: "/",
|
||||
scope: "/",
|
||||
display: "standalone",
|
||||
background_color: "#ffffff",
|
||||
theme_color: "#000000",
|
||||
orientation: "any",
|
||||
icons: [
|
||||
{ src: "/assets/icon-192x192.png", sizes: "192x192", type: "image/png", purpose: "any" },
|
||||
{ src: "/assets/icon-256x256.png", sizes: "256x256", type: "image/png", purpose: "any" },
|
||||
{ src: "/assets/icon-384x384.png", sizes: "384x384", type: "image/png", purpose: "any" },
|
||||
{ src: "/assets/icon-512x512.png", sizes: "512x512", type: "image/png", purpose: "any" },
|
||||
|
||||
{ src: "/assets/icon-192x192-maskable.png", sizes: "192x192", type: "image/png", purpose: "maskable" },
|
||||
{ src: "/assets/icon-512x512-maskable.png", sizes: "512x512", type: "image/png", purpose: "maskable" },
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,png,svg}'],
|
||||
cleanupOutdatedCaches: true,
|
||||
clientsClaim: true,
|
||||
skipWaiting: true,
|
||||
navigateFallback: null,
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user