-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
47 lines (46 loc) · 1.32 KB
/
vite.config.ts
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
import { fileURLToPath } from 'node:url'
import browserslistToEsbuild from 'browserslist-to-esbuild'
import solidDevTools from 'solid-devtools/vite'
import { defineConfig } from 'vite'
import 'vitest/config'
import { createHtmlPlugin } from 'vite-plugin-html'
import solidPlugin from 'vite-plugin-solid'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import manifestPlugin from './lib/vite/manifest-plugin.js'
export default defineConfig((config) => ({
build: {
target: browserslistToEsbuild(),
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'styled-system': fileURLToPath(new URL('./styled-system', import.meta.url)),
'@test': fileURLToPath(new URL('./test-support', import.meta.url)),
},
},
plugins: [
solidDevTools({ autoname: true }),
solidPlugin({ hot: config.mode === 'development' }),
createHtmlPlugin({ minify: true }),
viteStaticCopy({
targets: [
{
src: 'src/_locales/*',
dest: '_locales',
},
],
}),
manifestPlugin({
sourcePath: fileURLToPath(new URL('./src/manifest.json', import.meta.url)),
}),
],
test: {
setupFiles: ['test-support/setup.ts'],
watch: false,
globals: true,
environment: 'happy-dom',
coverage: {
include: ['src'],
},
},
}))