forked from pkgxdev/ossapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
57 lines (54 loc) · 1.39 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
45
46
47
48
49
50
51
52
53
54
55
56
57
import { sveltekit } from "@sveltejs/kit/vite";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import type { UserConfig } from "vite";
import path from "path";
import { version } from "../package.json";
const isMock = process.env.BUILD_FOR === "preview";
const config: UserConfig = {
build: {
sourcemap: true
},
plugins: [
sveltekit(),
process.env.SENTRY_AUTH_TOKEN &&
sentryVitePlugin({
org: "tea-inc",
project: "electron",
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
assets: "./build/**"
},
release: version
})
],
resolve: {
alias: {
// this dynamic-ish static importing is followed by the svelte build
// but for vscode editing intellisense tsconfig.json is being used
"@native": isMock
? path.resolve("./src/libs/native-mock.ts")
: path.resolve("./src/libs/native-electron.ts"),
$components: path.resolve("./src/components"),
$libs: path.resolve("./src/libs"),
$appcss: path.resolve("./src/app.css")
}
},
server: {
port: 3000,
fs: {
allow: [".."]
}
},
test: {
// Jest like globals
globals: true,
environment: "jsdom",
include: ["src/**/*.{test,spec}.ts"],
// Extend jest-dom matchers
setupFiles: ["./setupTest.js"],
coverage: {
provider: "c8"
}
}
};
export default config;