mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
refactor: separate standalone Vite wiring and provider middleware
This commit is contained in:
1 parent
493acfc6aa
commit
8de1018c21
35 files changed
+8078
-7919
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import cesium from 'vite-plugin-cesium';
|
||||
|
||||
/** Build browser assets with explicit inputs; never load environment or providers. */
|
||||
export function createBrowserViteConfig({
|
||||
plugins = [], googleApiKey, cesiumToken, host = 'localhost', port = 4173,
|
||||
} = {}) {
|
||||
return {
|
||||
plugins: [cesium(), ...plugins],
|
||||
server: {
|
||||
host: host || 'localhost',
|
||||
port: parseInt(port, 10) || 4173,
|
||||
allowedHosts: host === '0.0.0.0' || host === '::'
|
||||
? true : ['localhost', '127.0.0.1', '.local'],
|
||||
fs: { deny: ['.env', '.env.*', '*.{crt,pem}', '**/.git/**', '**/ENVIRONMENT'] },
|
||||
// These headers protect the document containing Provider Settings.
|
||||
headers: {
|
||||
'X-Frame-Options': 'DENY',
|
||||
'Content-Security-Policy': "frame-ancestors 'none'",
|
||||
},
|
||||
},
|
||||
define: {
|
||||
'import.meta.env.GOOGLE_MAPS_API_KEY': JSON.stringify(googleApiKey),
|
||||
'import.meta.env.CESIUM_ION_TOKEN': JSON.stringify(cesiumToken),
|
||||
},
|
||||
build: { chunkSizeWarningLimit: 1500 },
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user