-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
90 lines (88 loc) · 2.41 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
80
81
82
83
84
85
86
87
88
89
90
import { defineConfig } from "vite";
import path from "path";
import babel from "vite-plugin-babel";
import { VitePWA } from "vite-plugin-pwa";
import { viteStaticCopy } from "vite-plugin-static-copy";
export default defineConfig({
build: {
minify: "terser",
rollupOptions: {
external: [/wasm\/.*\.js/],
},
},
plugins: [
babel({
babelConfig: {
babelrc: false,
configFile: false,
presets: ["@babel/preset-typescript"],
plugins: [
["@babel/plugin-proposal-decorators", { version: "2023-05" }],
],
sourceMaps: "inline",
},
filter: /\.[jt]sx?$/,
}),
VitePWA({
devOptions: {
enabled: true,
type: "module",
},
registerType: "autoUpdate",
strategies: "injectManifest",
injectRegister: false,
srcDir: "./src/shared",
filename: "sw.ts",
injectManifest: {
globPatterns: ["**/*.{css,js,html,ico,png,svg,wasm,woff2}"],
},
manifest: {
name: "Time Station Emulator",
short_name: "Time Station Emulator",
description:
'Turns almost any phone or tablet into a low-frequency radio transmitter broadcasting a time signal that can synchronize most radio-controlled ("atomic") clocks and watches. Runs entirely in your browser with no installation or signup.',
theme_color: "#202020",
background_color: "#202020",
icons: [
{
src: "pwa-64x64.png",
sizes: "64x64",
type: "image/png",
},
{
src: "pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "maskable-icon-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
}),
viteStaticCopy({
targets: [{ src: "./wasm/*.{js,wasm}", dest: "wasm" }],
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@components": path.resolve(__dirname, "./src/components"),
"@shared": path.resolve(__dirname, "./src/shared"),
},
},
server: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
});