This repository was archived by the owner on Oct 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
82 lines (79 loc) · 2.38 KB
/
vite.config.ts
File metadata and controls
82 lines (79 loc) · 2.38 KB
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
import pandacss from "@pandacss/dev/postcss";
import { reactRouter } from "@react-router/dev/vite";
import AutoImport from "unplugin-auto-import/vite";
import Unfonts from "unplugin-fonts/vite";
import IconsResolver from "unplugin-icons/resolver";
import Icons from "unplugin-icons/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
// eslint-disable-next-line node/prefer-global/process
const host = process.env["TAURI_DEV_HOST"];
// https://vite.dev/config/
export default defineConfig({
plugins: [
reactRouter(),
tsconfigPaths(),
// NOTE: インポートなしにアイコンを使用できるようにするための設定
// ref: https://github.com/unplugin/unplugin-icons/blob/3831eb07d96e94d503df62f45512f3ca3e50cc26/README.md#auto-importing
AutoImport({
resolvers: [
IconsResolver({
prefix: "Icon",
extension: "jsx",
}),
],
}),
Icons({
autoInstall: true,
compiler: "jsx",
jsx: "react",
}),
Unfonts({
custom: {
families: [
{
name: "UDEV Gothic 35NF",
src: "./src/assets/fonts/UDEVGothic35NF-*",
},
{
name: "LINE Seed JP",
src: "./src/assets/fonts/LINESeedJP_*",
},
],
},
}),
],
css: {
postcss: {
plugins: [
// @ts-expect-error: 本来 `postcss.config.cjs` で設定するものをここで設定している
pandacss,
// NOTE: PandaCSS で勧められている `autoprefixer`, `@csstools/postcss-cascade-layers` を内包している `postcss-preset-env` を使用
// ref: https://github.com/csstools/postcss-plugins/tree/27b9126dc2f049aa20b02f7e3dbbb2c5c6c87f43/plugin-packs/postcss-preset-env
// postcssPresetEnv,
],
},
},
// 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,
host: host ?? false,
hmr:
host != null
? {
protocol: "ws",
host,
port: 1421,
}
: {},
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
});