forked from sunflower-land/sunflower-land
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
65 lines (64 loc) · 1.51 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
import { defineConfig } from "vite";
import reactRefresh from "@vitejs/plugin-react-refresh";
import tsconfigPaths from "vite-tsconfig-paths";
import { minifyHtml, injectHtml } from "vite-plugin-html";
import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
reactRefresh(),
tsconfigPaths(),
minifyHtml(),
injectHtml({
// TODO with API environment variables
injectData: {},
}),
VitePWA({
// strategies: "injectManifest",
// srcDir: "src",
// filename: "service-worker.js",
selfDestroying: true,
manifest: {
short_name: "Sunflower Land",
icons: [
{
src: `pwa/icon_pwa_144.png`,
sizes: "144x144",
type: "image/png",
},
{
src: `pwa/icon_pwa_192.png`,
sizes: "192x88",
type: "image/png",
},
{
src: `pwa/icon_pwa_512.png`,
sizes: "512x236",
type: "image/png",
},
],
display: "fullscreen",
theme_color: "#3E8848",
background_color: "#124E89",
},
}),
],
// Addresses web3 issue
resolve: {
alias: {
web3: "web3/dist/web3.min.js",
process: "process/browser",
stream: "stream-browserify",
zlib: "browserify-zlib",
util: "util",
},
},
css: {
modules: {},
},
base: "./",
build: {
chunkSizeWarningLimit: 1000,
assetsDir: "assets",
},
});