-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
57 lines (51 loc) · 1.23 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
import path from "node:path"
import { defineConfig } from "vite"
import { VitePWA } from "vite-plugin-pwa"
import inject from "@rollup/plugin-inject"
import { svelte } from "@sveltejs/vite-plugin-svelte"
import unocss from "@unocss/vite"
const moduleNameRegex = /\/node_modules\/(?!\.pnpm)(.+?)\//
export default defineConfig({
build: {
target: "firefox125",
rollupOptions: {
output: {
manualChunks: (id, { getModuleInfo }) => {
if (id.includes("node_modules")) {
if (id.includes("/svelte/")) {
return "svelte"
}
}
},
},
},
},
resolve: {
alias: {
"node:buffer": path.resolve("./node_modules/buffer"),
buffer: path.resolve("./node_modules/buffer"),
},
},
plugins: [
svelte(),
unocss(),
inject({ Buffer: ["buffer"] }) as never,
VitePWA({
registerType: "prompt",
injectRegister: "script-defer",
manifest: {
name: "REMsg Editor",
theme_color: "#222",
display: "minimal-ui",
orientation: "portrait",
icons: [
{
src: "/icon.png",
sizes: "256x256",
type: "image/png",
},
],
},
}),
],
})