-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
101 lines (99 loc) · 3.12 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import Unfonts from "unplugin-fonts/vite";
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
Unfonts({
custom: {
/**
* Fonts families lists
*/
families: [
{
/**
* Name of the font family.
*/
name: "BeaufortforLOL",
/**
* Local name of the font. Used to add `src: local()` to `@font-rule`.
*/
local: "BeaufortforLOL",
/**
* Regex(es) of font files to import. The names of the files will
* predicate the `font-style` and `font-weight` values of the `@font-rule`'s.
*/
src: "./src/assets/fonts/BeaufortforLOL/*.ttf",
transform: (font) => {
switch (font.basename) {
case "BeaufortforLOL-Regular":
font.weight = 400;
font.style = "normal";
return font;
case "BeaufortforLOL-Italic":
font.weight = 400;
font.style = "italic";
return font;
case "BeaufortforLOL-Light":
font.weight = 300;
font.style = "normal";
return font;
case "BeaufortforLOL-LightItalic":
font.weight = 300;
font.style = "italic";
return font;
case "BeaufortforLOL-Medium":
font.weight = 500;
font.style = "normal";
return font;
case "BeaufortforLOL-MediumItalic":
font.weight = 500;
font.style = "italic";
return font;
case "BeaufortforLOL-Bold":
font.weight = 700;
font.style = "normal";
return font;
case "BeaufortforLOL-BoldItalic":
font.weight = 700;
font.style = "italic";
return font;
case "BeaufortforLOL-Heavy":
font.weight = 900;
font.style = "normal";
return font;
case "BeaufortforLOL-HeavyItalic":
font.weight = 900;
font.style = "italic";
return font;
default:
return font;
}
},
},
],
},
}),
react(),
],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
watch: {
// 3. tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
envPrefix: ["VITE_", "TAURI_"],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
}));