-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.ts
127 lines (126 loc) · 3.42 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import svgrPlugin from "vite-plugin-svgr";
import macrosPlugin from "vite-plugin-babel-macros";
import OptimizationPersist from "vite-plugin-optimize-persist";
import PkgConfig from "vite-plugin-package-config";
import { visualizer } from "rollup-plugin-visualizer";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig(() => {
return {
define: {
"process.env": {
REACT_APP_IS_E2E: process.env.REACT_APP_IS_E2E,
REACT_APP_IS_UNIT: process.env.REACT_APP_IS_UNIT,
ZENDESK_WIDGET_KEY: process.env.ZENDESK_WIDGET_KEY,
},
},
build: {
target: "esnext",
rollupOptions: {
// https://rollupjs.org/guide/en/#big-list-of-options
output: {
manualChunks: {
react: [
"react",
"react-datepicker",
"react-dom",
"react-error-boundary",
"react-hook-form",
"react-i18next",
"react-idle-timer",
"react-linkify",
"react-loading-skeleton",
"react-qr-reader",
"react-range",
"react-router",
"react-router-dom",
"react-table",
"react-toastify",
"react-visibility-sensor",
],
sdk: ["@ardenthq/sdk"],
"sdk-ark": ["@ardenthq/sdk-ark"],
"sdk-cryptography": ["@ardenthq/sdk-cryptography"],
"sdk-helpers": ["@ardenthq/sdk-helpers"],
"sdk-intl": ["@ardenthq/sdk-intl"],
"sdk-ledger": ["@ardenthq/sdk-ledger"],
"sdk-profiles": ["@ardenthq/sdk-profiles"],
},
},
plugins: [
process.env.ANALYZE_BUNDLE &&
visualizer({
open: true,
brotliSize: true,
gzipSize: true,
template: "treemap",
}),
],
},
},
plugins: [
react(),
tsconfigPaths(),
svgrPlugin(),
macrosPlugin(),
PkgConfig(),
OptimizationPersist(),
VitePWA({
workbox: {
// Prevent from precaching html files. Caching index.html causes white-screen after each deployment.
// See: https://vite-plugin-pwa.netlify.app/guide/static-assets.html#globpatterns
globPatterns: ["**/*.{js,css}"],
},
includeAssets: [
"favicon.svg",
"favicon.ico",
"favicon-32x32.png",
"favicon-16x16.png",
"robots.txt",
"app-icon-192.png",
"app-maskable-icon-512.png",
"splashscreens/apple_320x568x2.png",
"splashscreens/apple_375x667x2.png",
"splashscreens/apple_375x812x3.png",
"splashscreens/apple_390x844x3.png",
"splashscreens/apple_414x736x2.6.png",
"splashscreens/apple_414x896x2.png",
"splashscreens/apple_414x896x3.png",
"splashscreens/apple_428x926x3.png",
"splashscreens/apple_768x1024x2.png",
"splashscreens/apple_834x1112x2.png",
"splashscreens/apple_834x1194x2.png",
"splashscreens/apple_1024x1366x2.png",
],
registerType: "autoUpdate",
manifest: {
display: "standalone",
lang: "en-US",
orientation: "portrait-primary",
start_url: "/",
name: "ARK Vault",
short_name: "ARK Vault",
description: "Control Your Assets",
theme_color: "#235b95",
background_color: "#235b95",
icons: [
{
src: "app-icon-192.png",
sizes: "192x192",
type: "image/png",
purpose: "any",
},
{
src: "app-maskable-icon-512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
}),
],
};
});