Document Phase 0 scaffold and architecture
This commit is contained in:
29
vite.renderer.config.ts
Normal file
29
vite.renderer.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import path from 'node:path';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const contentSecurityPolicy =
|
||||
mode === 'development'
|
||||
? "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' ws://localhost:*"
|
||||
: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'";
|
||||
|
||||
return {
|
||||
root: path.resolve(__dirname, 'src/renderer'),
|
||||
plugins: [
|
||||
react(),
|
||||
{
|
||||
name: 'max-index-content-security-policy',
|
||||
transformIndexHtml: (html) =>
|
||||
html.replace(
|
||||
'__MAX_INDEX_CONTENT_SECURITY_POLICY__',
|
||||
contentSecurityPolicy,
|
||||
),
|
||||
},
|
||||
],
|
||||
build: {
|
||||
emptyOutDir: false,
|
||||
outDir: path.resolve(__dirname, '.vite/renderer/main_window'),
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user