-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
61 lines (60 loc) · 1.45 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
import viteReact from "@vitejs/plugin-react";
import autoprefixer from "autoprefixer";
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
build: {
rollupOptions: {
output: {
manualChunks: function (id) {
if (id.includes("fortawesome")) {
return "icons";
}
if (id.includes("mathjs")) {
return "mathjs";
}
if (id.includes("node_modules")) {
return "vendors";
}
if (id.includes("translations")) {
return "translations";
}
},
},
},
target: "esnext",
},
css: {
postcss: {
plugins: [autoprefixer],
},
},
plugins: [
viteReact(),
VitePWA({
manifest: {
description:
"A versatile calculator app that offers a wide range of calculation features, supporting regular and scientific calculations, number base conversions, byte conversions, date difference calculations, molar mass calculations, statistical calculations, equation solving, and quadratic function analysis.",
icons: [
{
purpose: "any",
sizes: "720x720",
src: "https://www.shangzhenyang.com/images/avatar.png",
type: "image/png",
},
],
id: "/",
name: "Calculator",
short_name: "Calculator",
theme_color: "#0066cc",
},
registerType: "autoUpdate",
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});