Files
FarmaFinder/frontend/vite.config.js
T
Ichitux 2eff93e66a
Build & Push Docker Images / test-backend (push) Successful in 44s
Build & Push Docker Images / test-frontend (push) Successful in 52s
Build & Push Docker Images / build-backend (push) Failing after 34s
Build & Push Docker Images / build-frontend (push) Failing after 30s
More changes than expected. Mobile version improvements & PWA
2026-05-20 22:28:17 +02:00

53 lines
1.4 KiB
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.js',
injectRegister: 'auto',
devOptions: {
enabled: true,
type: 'module',
navigateFallback: 'index.html',
},
manifest: {
name: 'FarmaFinder',
short_name: 'FarmaFinder',
description: 'Find pharmacies that stock the medicine you need',
theme_color: '#0f766e',
background_color: '#ffffff',
display: 'standalone',
start_url: '/',
icons: [
{ src: '/icon.svg', sizes: '192x192', type: 'image/svg+xml', purpose: 'any' },
{ src: '/icon.svg', sizes: '512x512', type: 'image/svg+xml', purpose: 'any' },
{ src: '/icon-mask.svg', sizes: '512x512', type: 'image/svg+xml', purpose: 'maskable' },
],
},
}),
],
test: {
environment: 'jsdom',
setupFiles: ['./src/test/setup.js'],
globals: true,
},
server: {
allowedHosts: ['localhost', 'farmacias.hacecalor.net'],
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
credentials: true,
},
},
},
});