Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
53
web/maplefile-frontend/vite.config.js
Normal file
53
web/maplefile-frontend/vite.config.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
// Security headers for development server
|
||||
headers: {
|
||||
"X-Content-Type-Options": "nosniff",
|
||||
"X-Frame-Options": "DENY",
|
||||
"X-XSS-Protection": "1; mode=block",
|
||||
"Referrer-Policy": "strict-origin-when-cross-origin",
|
||||
"Permissions-Policy": "geolocation=(), microphone=(), camera=()",
|
||||
},
|
||||
proxy: {
|
||||
// Proxy all API requests to backend server
|
||||
"/api": {
|
||||
target: "http://localhost:8000",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
// Legacy proxy for MapleFile API requests (kept for backward compatibility)
|
||||
"/maplefile/api": {
|
||||
target: "http://localhost:8000",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) => path.replace(/^\/maplefile/, ""),
|
||||
},
|
||||
// Legacy proxy for IAM API requests (kept for backward compatibility)
|
||||
"/iam/api": {
|
||||
target: "http://localhost:8000",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) => path.replace(/^\/iam/, ""),
|
||||
},
|
||||
},
|
||||
},
|
||||
// Production build security optimizations
|
||||
build: {
|
||||
// Enable minification for production (using esbuild)
|
||||
minify: "esbuild",
|
||||
// Generate source maps for debugging (but not inline)
|
||||
sourcemap: false,
|
||||
// Warn about large chunks
|
||||
chunkSizeWarningLimit: 1000,
|
||||
},
|
||||
// Additional esbuild options for security
|
||||
esbuild: {
|
||||
// Remove console.log and debugger in production
|
||||
drop: process.env.NODE_ENV === 'production' ? ['console', 'debugger'] : [],
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue