-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
58 lines (57 loc) · 1.29 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
import react from "@vitejs/plugin-react";
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes("fortawesome")) {
return "icons";
}
if (id.includes("framer-motion")) {
return "framer-motion";
}
if (id.includes("nextui")) {
return "nextui";
}
if (id.includes("node_modules")) {
return "vendors";
}
if (id.includes("translations")) {
return "translations";
}
},
},
},
target: "esnext",
},
plugins: [
react(),
VitePWA({
manifest: {
description:
"Encoder is a web-based tool that allows you to easily encode text into various formats, including base64, binary, MD5, Morse code, QR code, Unicode, URI Component, and more.",
icons: [
{
purpose: "any",
sizes: "720x720",
src: "https://www.shangzhenyang.com/images/avatar.png",
type: "image/png",
},
],
id: "/",
name: "Encoder",
short_name: "Encoder",
theme_color: "#006fee",
},
registerType: "autoUpdate",
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});