-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
81 lines (74 loc) · 1.62 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
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
/// <reference types="vitest" />
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import ExportCollector from 'unplugin-export-collector/vite'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
import { configDefaults } from 'vitest/config'
import alias from './alias'
import pkg from './package.json'
import HandleResolvers from './plugins/resolvers'
export default defineConfig({
plugins: [
vue(),
UnoCSS(),
dts({ rollupTypes: true }),
ExportCollector({
exclude: [
'Located',
],
}),
HandleResolvers(),
],
test: {
environment: 'jsdom',
exclude: [
...configDefaults.exclude,
'e2e/*',
'**/public/**',
'**/.{vscode,svn}/**',
],
root: fileURLToPath(new URL('./', import.meta.url)),
includeSource: [
'src/core/composables/**/*.ts',
'src/core/components/**/*.ts',
'src/core/utils/**/*.ts',
'src/shared/**/*.ts',
],
},
build: {
lib: {
entry: [
'./src/index.ts',
'./src/imports.ts',
'./src/resolvers.ts',
],
formats: ['es'],
fileName(_, entryName) {
return `${entryName}.mjs`
},
},
rollupOptions: {
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.devDependencies || {}),
],
},
minify: false,
},
resolve: {
alias,
},
define: {
'import.meta.vitest': 'undefined',
},
server: {
host: '0.0.0.0',
warmup: {
clientFiles: [
'./src/demo/container.vue',
],
},
},
})