Files
userApp/vite.config.ts
2025-04-29 22:22:52 +03:30

87 lines
2.6 KiB
TypeScript

import path from 'path';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
// strategies: 'injectManifest',
// srcDir: 'public',
// filename: 'firebase-messaging-sw.js',
// injectRegister: 'auto',
// devOptions: { enabled: true },
manifest: {
name: 'Salona',
short_name: 'Salona',
start_url: '/',
display: 'standalone',
background_color: '#FFFFFF',
lang: 'fa',
scope: '/',
dir: 'rtl',
id: '/',
orientation: 'portrait',
theme_color: '#AB25C0',
description:
'Salona is a platform to provide innovative tools to hairdressers and beauty salons.',
display_override: [
'standalone',
'fullscreen',
'window-controls-overlay',
'browser',
],
icons: [
{
src: '/favicon.ico',
sizes: 'any',
type: 'image/x-icon',
},
{ src: 'pwa-48x48.png', sizes: '48x48', type: 'image/png' },
{ src: 'pwa-72x72.png', sizes: '72x72', type: 'image/png' },
{ src: 'pwa-96x96.png', sizes: '96x96', type: 'image/png' },
{ src: 'pwa-128x128.png', sizes: '128x128', type: 'image/png' },
{ src: 'pwa-144x144.png', sizes: '144x144', type: 'image/png' },
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{ src: 'pwa-256x256.png', sizes: '256x256', type: 'image/png' },
{ src: 'pwa-384x384.png', sizes: '384x384', type: 'image/png' },
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
categories: ['makeup', 'beauty', 'lifestyle', 'social'],
prefer_related_applications: false,
related_applications: [],
},
workbox: {
cleanupOutdatedCaches: true,
skipWaiting: true,
clientsClaim: true,
// Set the maximum file size to cache to 3 MiB (3 * 1024 * 1024 bytes)
maximumFileSizeToCacheInBytes: 3 * 1024 * 1024,
},
}),
],
server: {
https: {
key: './localhost_5173-privateKey.key',
cert: './localhost_5173.crt',
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@package.json': path.resolve(__dirname, './package.json'),
},
},
});