forked from csaf-poc/csaf_webview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
44 lines (40 loc) · 1.2 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
// This file is Free Software under the MIT License
// without warranty, see README.md and LICENSES/MIT.txt for details.
//
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
// Software-Engineering: 2023 Intevation GmbH <https://intevation.de>
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vitest/config";
import { readFileSync } from "fs";
import { fileURLToPath } from "url";
const file = fileURLToPath(new URL("package.json", import.meta.url));
const json = readFileSync(file, "utf8");
const pkg = JSON.parse(json);
export default defineConfig({
server: {
proxy: {
"/proxy/": {
target: "https://wid.cert-bund.de/",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/proxy\//, "")
}
}
},
plugins: [sveltekit()],
test: {
include: ["src/**/*.{test,spec}.{js,ts}"],
coverage: {
provider: "istanbul",
reporter: ["text", "json-summary", "json", "html"],
lines: 60,
branches: 60,
functions: 60,
statements: 60
}
},
define: {
__APP_VERSION__: `${JSON.stringify(pkg.version)}`
}
});