Skip to content

Commit

Permalink
fix the csp issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wheattoast11 committed Nov 30, 2024
1 parent 0361170 commit 854b684
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default defineConfig({
}
},
chunkSizeWarningLimit: 1000,
sourcemap: false,
sourcemap: true,
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
drop_console: false,
drop_debugger: false
}
}
},
Expand All @@ -31,6 +31,34 @@ export default defineConfig({
optimizeDeps: {
include: ['three', 'framer-motion', 'pts']
},
publicDir: 'public',
assetsInclude: ['**/*.png', '**/*.ico', '**/*.webmanifest']
server: {
headers: {
'Content-Security-Policy': `
default-src 'self';
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob:;
font-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
`.replace(/\s+/g, ' ').trim()
}
},
preview: {
headers: {
'Content-Security-Policy': `
default-src 'self';
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob:;
font-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
`.replace(/\s+/g, ' ').trim()
}
}
});

0 comments on commit 854b684

Please sign in to comment.