Files
flxn-app/vite.config.ts
yohlo fb4f50b851
All checks were successful
CI/CD Pipeline / Build and Push App Docker Image (push) Successful in 3m41s
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 8s
CI/CD Pipeline / Deploy to Kubernetes (push) Successful in 44s
pwa
2026-03-02 00:49:18 -06:00

65 lines
1.7 KiB
TypeScript

import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig(({ mode }) => ({
server: {
port: 3000,
allowedHosts: ["dev.flexxon.app", "flexxon.app"]
},
ssr: {
noExternal: mode === 'production' ? true : ['facehash'],
},
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart({
srcDirectory: 'src/app',
}),
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: false,
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365 // 1 year
},
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'gstatic-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365 // 1 year
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
devOptions: {
enabled: false
}
})
]
}))