This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
84 lines (83 loc) · 2.55 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
/// <reference types="vitest" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { VitePWA } from "vite-plugin-pwa";
import { checker } from "vite-plugin-checker";
import Icons from "unplugin-icons/vite";
import { imagetools } from "vite-imagetools";
import AutoImport from "unplugin-auto-import/vite";
//@ts-expect-error but it's on?
import PackageJSON from "./package.json";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig({
optimizeDeps: {
exclude: process.env.NODE_ENV === "production" ? ["lodash"] : [],
},
define: {
APP_NAME: JSON.stringify(PackageJSON.name),
APP_VERSION: JSON.stringify(PackageJSON.version),
},
build: {
rollupOptions: {
output: {
manualChunks: {
mui: ["@mui/material", "@mui/x-date-pickers"],
react: ["react", "react-dom", "react-router-dom"],
lodash: ["lodash"],
},
},
},
},
plugins: [
react(),
Icons({
compiler: "jsx",
jsx: "react",
defaultClass: "iconified",
}),
AutoImport({
imports: ["react", "react-router-dom", "react-i18next", "ahooks", { imports: ["z"], from: "zod",type: true }],
dts: "./src/auto-import.d.ts",
}),
checker({
typescript: true,
overlay: {
initialIsOpen: false,
},
eslint: {
lintCommand: "eslint ./src",
},
}),
VitePWA({
registerType: "autoUpdate",
manifest: {
name: "Gdakon Pocket Schedule",
short_name: "Gdakon",
description: "Check the Gdakon schedule from your phone!",
lang: "en",
theme_color: "#3a3d80",
icons: [
{
src: "https://gdakon.org/favicon.ico",
sizes: "16x16",
type: "image/icon",
},
],
},
workbox: {
globPatterns: [
"**/*.{js,css,html,ico,png,svg,json,webp,woff,woff2,ico}",
],
cleanupOutdatedCaches: true,
sourcemap: true,
},
}),
imagetools(),
tsconfigPaths()
],
test: {
passWithNoTests: true,
environment: "happydom",
}
});