Replace master branch with local files
This commit is contained in:
commit
875a53f499
60 changed files with 21637 additions and 0 deletions
56
frontend/svelte.config.js
Normal file
56
frontend/svelte.config.js
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
import adapter from '@sveltejs/adapter-node';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
preprocess: vitePreprocess(),
|
||||
|
||||
kit: {
|
||||
adapter: adapter({
|
||||
out: 'build',
|
||||
precompress: false
|
||||
}),
|
||||
|
||||
// Security improvements
|
||||
csp: {
|
||||
mode: 'auto',
|
||||
directives: {
|
||||
'default-src': ["'self'"],
|
||||
'script-src': ["'self'", "'unsafe-inline'"],
|
||||
'style-src': ["'self'", "'unsafe-inline'", 'https://cdnjs.cloudflare.com'],
|
||||
'img-src': ["'self'", 'data:', 'blob:'],
|
||||
'font-src': ["'self'", 'https://cdnjs.cloudflare.com'],
|
||||
'connect-src': ["'self'", 'ws://localhost', 'wss://localhost', 'http://localhost:*'],
|
||||
'media-src': ["'self'", 'blob:', 'http://localhost:*'],
|
||||
'object-src': ["'none'"],
|
||||
'frame-ancestors': ["'none'"],
|
||||
'form-action': ["'self'"],
|
||||
'base-uri': ["'self'"]
|
||||
}
|
||||
},
|
||||
|
||||
// Enable CSRF protection (default is true)
|
||||
csrf: {
|
||||
checkOrigin: true
|
||||
},
|
||||
|
||||
// Environment variable configuration
|
||||
env: {
|
||||
publicPrefix: 'VITE_' // This is already correct
|
||||
},
|
||||
|
||||
// Ensure default appDir is used (don't override)
|
||||
// appDir: '_app' // This is the default, no need to set
|
||||
|
||||
// Performance: prerender error pages
|
||||
prerender: {
|
||||
entries: ['/'],
|
||||
handleHttpError: ({ path, referrer, message }) => {
|
||||
// Log errors but don't fail build
|
||||
console.warn(`${path} (${referrer}) - ${message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
Loading…
Add table
Add a link
Reference in a new issue