27 lines
749 B
TypeScript
27 lines
749 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tsconfigPaths(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate', // Automatically updates the service worker when a new version is available
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,png,jpg,svg}'], // Cache all common asset types
|
|
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5 MiB
|
|
},
|
|
}),
|
|
],
|
|
build: {
|
|
outDir: './build',
|
|
sourcemap: true,
|
|
minify: false,
|
|
},
|
|
esbuild: {
|
|
keepNames: true, // Prevent function name mangling
|
|
}
|
|
})
|