-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathvite.config.js
More file actions
81 lines (79 loc) · 2.09 KB
/
vite.config.js
File metadata and controls
81 lines (79 loc) · 2.09 KB
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
// vite.config.js
/* eslint-env node */
import { fileURLToPath } from "node:url";
import { resolve, dirname } from "node:path";
import { defineConfig } from "vite";
import eslint from "vite-plugin-eslint";
import legacy from "@vitejs/plugin-legacy"; // eslint-disable-line import/no-unresolved
import { VitePWA } from "vite-plugin-pwa";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
publicDir: "public",
root: "./",
build: {
outDir: "dist",
sourcemap: true,
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
},
},
},
plugins: [
eslint({
cache: false,
fix: true,
}),
legacy({}),
VitePWA({
injectRegister: "inline",
workbox: {
globPatterns: ["**/*.{js,css,html,png,svg}"],
cleanupOutdatedCaches: false,
},
includeAssets: ["icons/*"],
manifest: {
name: "Serial Projector",
short_name: "SerialProjector",
description:
"A simple web application that shows last line of text got from serial port with a big font.",
categories: ["developer", "developer tools", "eductaion", "utilities"],
theme_color: "#f6871f",
icons: [
{
src: "icons/icon-192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "icons/icon-512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "icons/maskable-icon-512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
screenshots: [
{
src: "screenshots/home.png",
sizes: "1920x1080",
type: "image/png",
label: "Home screen",
},
{
src: "screenshots/home-wide.webp",
sizes: "1280x720",
type: "image/webp",
form_factor: "wide",
label: "Wide home screen",
},
],
},
}),
],
});