forked from med-art/MindArtMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
79 lines (77 loc) · 1.88 KB
/
vite.config.js
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
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
import fs from "fs";
// Transform HTML during build
function htmlUrlPlugin() {
return {
name: "html-transform",
transformIndexHtml(html) {
return html.replace(
/(src|href)="\.?\/(images|sound)\//g,
`$1="/DevMinDArT/$2/`
);
},
};
}
export default defineConfig({
base: "/DevMinDArT/",
build: {
outDir: "dist",
chunkSizeWarningLimit: 1200,
rollupOptions: {
input: {
main: "./index.html",
},
},
},
plugins: [
htmlUrlPlugin(),
VitePWA({
registerType: "autoUpdate",
injectRegister: "auto",
workbox: {
globPatterns: ["**/*.{js,css,html,woff2,ico,png,svg,webp,mp3}"],
cleanupOutdatedCaches: true,
skipWaiting: true,
clientsClaim: true,
},
manifest: {
name: "MinDArT",
short_name: "MinDArT",
description: "Mind art progressive web app, for offline use",
theme_color: "#ffffff",
background_color: "#ffffff",
display: "standalone",
scope: "/DevMinDArT/",
start_url: "/DevMinDArT/",
orientation: "any",
icons: [
{
src: "images/mindart-logo_192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "images/mindart-logo_512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "images/mindart-logo_512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "images/mindart-logo_mask.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
categories: ["art", "education", "health"],
},
}),
],
publicDir: "assets",
});