mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-28 12:49:03 +00:00
35a57e5fa7
Two console errors on HTTP deployments with no functional impact: 1. Helmet's default Cross-Origin-Opener-Policy: same-origin is ignored by browsers over HTTP but logged as a console error. Disabled via crossOriginOpenerPolicy: false (same rationale as HSTS/COEP). 2. Vite's production build injects an inline module-preload polyfill script blocked by script-src 'self'. Disabled via build.modulePreload.polyfill: false — all modern browsers support link rel="modulepreload" natively.
36 lines
947 B
TypeScript
36 lines
947 B
TypeScript
import { defineConfig } from 'vite'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
build: {
|
|
// Disable the module-preload polyfill inline script.
|
|
// Vite injects a small inline <script> for module preloading that violates
|
|
// our CSP (script-src 'self' blocks all inline scripts). All modern browsers
|
|
// support <link rel="modulepreload"> natively, so the polyfill is unnecessary.
|
|
modulePreload: { polyfill: false },
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
'/ws': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
})
|