64 lines
1.4 KiB
TypeScript
64 lines
1.4 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { VitePWA } from "vite-plugin-pwa";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: "autoUpdate",
|
|
workbox: {
|
|
globPatterns: ["**/*.{js,css,html,ico,png,svg}"],
|
|
},
|
|
manifest: {
|
|
name: "STUPA PDF API",
|
|
short_name: "STUPA",
|
|
description: "Projektantragsmanagementsystem",
|
|
theme_color: "#1976d2",
|
|
background_color: "#ffffff",
|
|
icons: [
|
|
{
|
|
src: "/icon-192x192.png",
|
|
sizes: "192x192",
|
|
type: "image/png",
|
|
},
|
|
{
|
|
src: "/icon-512x512.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:8000",
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
vendor: ["react", "react-dom", "react-router-dom"],
|
|
mui: ["@mui/material", "@mui/icons-material"],
|
|
forms: ["react-hook-form", "@hookform/resolvers", "yup"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": "/src",
|
|
},
|
|
},
|
|
});
|