-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
140 lines (139 loc) · 3.49 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import { configDefaults, defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import { VitePWA as vite_pwa } from 'vite-plugin-pwa'
import { fileURLToPath } from 'node:url'
import fs from 'fs'
import path from 'path'
import wasm from 'vite-plugin-wasm'
export default defineConfig({
build: {
target: 'esnext',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
vendor: [
'vue',
'vue-router',
'@vueuse/core',
'@firebase/app',
'@firebase/auth',
'@firebase/firestore',
'@firebase/storage'
],
utilities: ['libphonenumber-js', 'exifreader']
}
}
}
},
define: {
'import.meta.env.PACKAGE_VERSION': JSON.stringify(
process.env['npm_package_version']
)
},
server: {
port: 8080,
watch: {
ignored: ['**/artifacts/**', '**/dist/**', '**/node_modules/**']
},
https: {
key: fs.readFileSync('localhost-key.pem'),
cert: fs.readFileSync('localhost.pem')
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@@': fileURLToPath(new URL('./tests/mocks', import.meta.url))
},
extensions: ['.js', '.json', '.vue']
},
css: {
preprocessorOptions: {
stylus: {
imports: [
new URL('./src/style/variables.styl', import.meta.url).pathname
]
}
}
},
plugins: [
vue(),
wasm(),
vite_pwa({
workbox: {
maximumFileSizeToCacheInBytes: 4000000
},
filename: 'service.worker.js',
minify: true,
includeAssets: [
'180.png',
'vector.worker.js',
'fonts/*.woff2',
'icons.svg'
],
manifest: {
display: 'standalone',
background_color: '#151518',
name: 'Realness',
short_name: 'Realness',
description: 'Realness – A Chill Vector Space',
scope: '/',
orientation: 'portrait',
theme_color: '#151518',
icons: [
{ src: '192.png', sizes: '192x192', type: 'image/png' },
{ src: '512.png', sizes: '512x512', type: 'image/png' },
{
src: '512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable'
}
]
}
})
],
test: {
root: '.',
globals: true,
environment: 'happy-dom',
include: ['tests/**/*.spec.js'],
exclude: [...configDefaults.exclude, '**/setup.js', '**/mocks/**'],
coverage: {
include: ['src/**/*.js', 'src/**/*.vue'],
exclude: [
'tests/**',
'mocks/**',
'node_modules/**',
'dist/**',
'docs/**',
'public/**'
],
lines: 80,
branches: 80,
statements: 80,
functions: 80,
all: true,
excludeNodeModules: true,
provider: 'v8',
reporter: ['text', 'html', 'json'],
reportsDirectory: './coverage',
reportOnFailure: true
},
mockReset: false,
setupFiles: [
'./tests/setup.js',
'./tests/mocks/default.js',
'./tests/mocks/browser/console.js',
'./tests/mocks/browser/fetch.js',
'./tests/mocks/browser/worker.js',
'./tests/mocks/browser/indexedDB.js',
'./tests/mocks/browser/localStorage.js',
'./tests/mocks/browser/createrange.js',
'./tests/mocks/browser/scrollIntoView.js',
'./tests/mocks/browser/IntersectionObserver.js',
'./tests/mocks/browser/FileReaderSync.js'
]
}
})