feat: transform Freshers-Hub into installable Progressive Web App (PWA) with offline caching
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
import path from 'path'
|
||||
|
||||
// https://vite.dev/config/
|
||||
@@ -8,6 +9,43 @@ export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
tailwindcss(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'map.png'],
|
||||
manifest: {
|
||||
name: 'RIT Freshers Hub',
|
||||
short_name: 'Freshers Hub',
|
||||
description: 'Your all-in-one AI-powered student portal for Rajalakshmi Institute of Technology.',
|
||||
theme_color: '#F97316',
|
||||
background_color: '#FAFAFA',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
scope: '/',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{
|
||||
src: 'pwa-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'pwa-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'pwa-maskable-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
purpose: 'maskable'
|
||||
}
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,webm}'],
|
||||
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024
|
||||
}
|
||||
})
|
||||
],
|
||||
server: {
|
||||
host: true,
|
||||
|
||||
Reference in New Issue
Block a user