-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.ts
93 lines (91 loc) · 2.21 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
/// <reference types="vitest" />
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";
import unfonts from "unplugin-fonts/vite";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
const resolve = {
alias: ["components", "images", "native-api", "stores", "utils"].map(
(alias) => ({
find: `@/${alias}`,
replacement: path.resolve(__dirname, `src/${alias}`),
}),
),
};
export default defineConfig({
build: {
outDir: "./build",
chunkSizeWarningLimit: 2000,
},
resolve,
test: {
globals: true,
environment: "happy-dom",
include: ["src/**/*.test.{ts,tsx}"],
},
plugins: [
react(),
unfonts({
custom: {
families: [
{
name: "Geist Sans",
src: "node_modules/geist/dist/fonts/geist-sans/*.woff2",
},
{
name: "Geist Mono",
src: "node_modules/geist/dist/fonts/geist-mono/*.woff2",
},
],
},
}),
tailwindcss(),
VitePWA({
includeAssets: [
"favicon.ico",
"apple-touch-icon-180x180.png",
"maskable-icon-512x512.png",
],
workbox: {
globPatterns: ["**/*.{js,css,html,json,png,woff2}"],
},
manifest: {
name: "2do.txt",
short_name: "2do.txt",
description: "todo.txt-compatible task manager",
theme_color: "#f1f5f966",
display_override: ["window-controls-overlay"],
icons: [
{
src: "pwa-64x64.png",
sizes: "64x64",
type: "image/png",
},
{
src: "/pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/maskable-icon-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
}),
],
});