forked from dscvr-one/blink-canvas-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
31 lines (29 loc) · 874 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import csp from 'vite-plugin-csp';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(),
nodePolyfills({
globals: {
Buffer: true,
},
protocolImports: true,
}),
],
build: {
// Ensure the build does not use inline scripts
rollupOptions: {
output: {
inlineDynamicImports: false
}
}
},
server: {
hmr: false, // Disable HMR to avoid inline script injection
headers: {
'Content-Security-Policy': "default-src 'self'; connect-src 'self' http://localhost:* https://*.dial.to/ https://proxy.dial.to/; img-src 'self' https://*.dial.to/ https://proxy.dial.to/; script-src 'self'; style-src 'self' 'unsafe-inline';"
}
},
})