2d4c3a57da
SvelteKit now handles script-src with automatic nonces via its built-in CSP support. The hooks handler merges extra directives (style-src, font-src, img-src, etc.) onto SvelteKit's nonce-based policy for page responses, and sets a full CSP for API responses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
372 B
JavaScript
22 lines
372 B
JavaScript
import adapter from '@sveltejs/adapter-node';
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
const config = {
|
|
kit: {
|
|
adapter: adapter(),
|
|
alias: {
|
|
$components: 'src/lib/components',
|
|
$server: 'src/lib/server',
|
|
$utils: 'src/lib/utils'
|
|
},
|
|
csp: {
|
|
directives: {
|
|
'default-src': ['self'],
|
|
'script-src': ['self']
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
export default config;
|