-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
33 lines (30 loc) · 997 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
32
33
/* eslint-disable no-useless-escape */
import { sveltekit } from "@sveltejs/kit/vite";
import type { UserConfig } from "vite";
import * as path from "path";
import * as dotenv from "dotenv";
dotenv.config();
const config: UserConfig = {
plugins: [sveltekit()],
resolve: {
alias: {
lib: path.resolve(__dirname, "src/lib"),
js: path.resolve(__dirname, "src/js"),
routes: path.resolve(__dirname, "src/routes"),
},
},
server: {
headers: {
"Content-Security-Policy": encodeURIComponent(`
connect-src https://hcaptcha.com, https://\*.hcaptcha.com ${process.env.VITE_API_URL};
frame-src: https://hcaptcha.com, https://\*.hcaptcha.com;
style-src: https://hcaptcha.com, https://\*.hcaptcha.com;
script-src: https://hcaptcha.com, https://\*.hcaptcha.com;
default-src 'self';
frame-ancestors 'self';
form-action 'self';
`),
},
},
};
export default config;