-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
83 lines (81 loc) · 2.03 KB
/
Copy pathvite.config.js
File metadata and controls
83 lines (81 loc) · 2.03 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
83
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import tailwindcss from "@tailwindcss/vite";
import { VitePWA } from "vite-plugin-pwa";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// https://vite.dev/config/
export default defineConfig({
base: "./",
plugins: [
preact(),
tailwindcss(),
VitePWA({
registerType: "autoUpdate",
injectRegister: "script-defer",
manifest: {
name: "ArX Financial Note",
short_name: "ArX Finote",
description:
"Aplikasi Single Page Application pencatatan keuangan modern, ultra-cepat, dan privasi penuh.",
theme_color: "#4f46e5",
background_color: "#080c14",
display: "standalone",
orientation: "portrait",
start_url: "./",
scope: "./",
icons: [
{
src: "./icon-192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "./icon-512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "./icon-512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@components": path.resolve(__dirname, "./src/components"),
"@pages": path.resolve(__dirname, "./src/pages"),
"@hooks": path.resolve(__dirname, "./src/hooks"),
"@utils": path.resolve(__dirname, "./src/utils"),
"@stores": path.resolve(__dirname, "./src/stores"),
"@assets": path.resolve(__dirname, "./src/assets"),
},
},
build: {
cssMinify: true,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
if (id.includes("lucide-preact")) return "vendor-icons";
if (id.includes("dayjs")) return "vendor-dayjs";
if (id.includes("idb") || id.includes("ulid"))
return "vendor-storage";
}
},
},
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: "./src/test/setup.js",
},
});