-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
81 lines (79 loc) · 1.75 KB
/
vite.config.ts
File metadata and controls
81 lines (79 loc) · 1.75 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
import path from "node:path";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
import { defineConfig } from "vitest/config";
// Use `Date.now()` instead of `new Date()` to make sure that the time is in `ja-JP` format properly (timezone issues).
const autoGeneratedAppVersion = Intl.DateTimeFormat("ja-JP", {
dateStyle: "long",
}).format(Date.now());
// https://vitejs.dev/config/
export default defineConfig({
build: {
target: "esnext",
},
define: {
"import.meta.env.VITE_APP_VERSION": JSON.stringify(autoGeneratedAppVersion),
},
plugins: [
tailwindcss(),
react(),
VitePWA({
devOptions: {
enabled: true,
},
filename: "sw.ts",
manifest: {
background_color: "#f1c40f",
description: "Speednote, the fastest way to put your quick thoughts!",
display: "standalone",
icons: [
{
sizes: "64x64 32x32 24x24 16x16",
src: "icon-64.png",
type: "image/png",
},
{
sizes: "128x128",
src: "icon-128.png",
type: "image/png",
},
{
sizes: "256x256",
src: "icon-256.png",
type: "image/png",
},
{
sizes: "512x512",
src: "icon-512.png",
type: "image/png",
},
],
name: "Speednote",
orientation: "portrait",
short_name: "Speednote",
start_url: "/",
theme_color: "#e67e22",
},
registerType: "autoUpdate",
srcDir: "app",
}),
],
resolve: {
alias: {
"~": path.resolve(import.meta.dirname, "./app"),
},
},
server: {
port: 3000,
},
test: {
coverage: {
exclude: ["app/index.tsx"], // Main function do not need testing.
include: ["app/**"],
},
environment: "jsdom",
globals: true,
include: ["__tests__/**/*"],
},
});