noteJS-react/vite.config.ts

38 lines
783 B
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: "prompt",
workbox: {
globPatterns: ["**/*.{js,css,html,ico,png,svg}"],
},
}),
],
server: {
port: 5173,
proxy: {
"/api": {
target: "http://localhost:3001",
changeOrigin: true,
secure: false,
ws: true,
},
"/uploads": {
target: "http://localhost:3001",
changeOrigin: true,
secure: false,
},
"/logout": {
target: "http://localhost:3001",
changeOrigin: true,
secure: false,
},
},
},
});