74 lines
1.9 KiB
TypeScript
74 lines
1.9 KiB
TypeScript
import { VitePWA } from 'vite-plugin-pwa';
|
|
import react from '@vitejs/plugin-react-swc';
|
|
import { defineConfig } from 'vite';
|
|
import path from "path";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), VitePWA({
|
|
strategies: 'injectManifest',
|
|
srcDir: 'src',
|
|
filename: 'sw.js',
|
|
registerType: 'autoUpdate',
|
|
injectRegister: false,
|
|
|
|
manifest: {
|
|
name: 'Salona',
|
|
short_name: 'Salona',
|
|
theme_color: '#ffffff',
|
|
dir: 'rtl',
|
|
lang: 'fa',
|
|
description: 'Salona is a platform to provide innovative tools to hairdressers and beauty salons.',
|
|
display_override: [
|
|
'standalone',
|
|
'fullscreen',
|
|
'window-controls-overlay',
|
|
'browser',
|
|
],
|
|
icons: [{
|
|
src: 'pwa-64x64.png',
|
|
sizes: '64x64',
|
|
type: 'image/png',
|
|
}, {
|
|
src: 'pwa-192x192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png',
|
|
}, {
|
|
src: 'pwa-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
}, {
|
|
src: 'maskable-icon-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'maskable',
|
|
}],
|
|
},
|
|
|
|
injectManifest: {
|
|
globPatterns: ['**/*.{js,css,html,svg,png,ico}'],
|
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
|
|
},
|
|
|
|
devOptions: {
|
|
enabled: false,
|
|
navigateFallback: 'index.html',
|
|
suppressWarnings: true,
|
|
type: 'module',
|
|
},
|
|
})],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'@package.json': path.resolve(__dirname, './package.json'),
|
|
'@appointment': path.resolve(__dirname, './src/apps/appointment'),
|
|
'@card': path.resolve(__dirname, './src/apps/card'),
|
|
'@new-ui': path.resolve(__dirname, './src/apps/new-ui'),
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
external: ['workbox-window'],
|
|
},
|
|
},
|
|
}) |