-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
71 lines (70 loc) · 2.1 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
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
// https://vitejs.dev/config/
export default defineConfig({
// By default, Vite will assume we are serving from the root of the domain
// (i.e. /); however, because we are serving Truthy from a subdirectory of my
// projects domain (e.g. https://projects.calebevans.me/truthy/), we must
// specify . as the base directory to serve from
base: './',
// Enable JSX processing
esbuild: {
// We need to use _m as the imported name so that it doesn't collide with
// explicitly importing _m, while still allowing us to have organizeImports
// strip out "unused" mithril imports
jsxInject: "import _m from 'mithril'",
jsxFactory: '_m',
jsxFragment: '_m.Fragment'
},
plugins: [
VitePWA({
filename: 'service-worker.js',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}'],
cleanupOutdatedCaches: true
},
manifest: {
short_name: 'Flip Book',
name: 'Flip Book',
description:
"Create flip book-style animations to share with friends. Draw each scene, frame by frame, then export your story to a GIF when you're ready to show it off.",
start_url: '.',
display: 'standalone',
orientation: 'any',
theme_color: '#ffffff',
background_color: '#ffffff',
icons: [
{
src: 'app-icon-192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'app-icon-192-maskable.png',
sizes: '192x192',
type: 'image/png',
purpose: 'maskable'
},
{
src: 'app-icon-512.png',
sizes: '512x512',
type: 'image/png'
},
{
src: 'app-icon-512-maskable.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable'
}
]
}
})
],
test: {
globals: true,
environment: 'jsdom',
coverage: {
reporter: ['text', 'lcov', 'html', 'text-summary']
}
}
});