-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
74 lines (73 loc) · 2.66 KB
/
Copy pathvite.config.ts
File metadata and controls
74 lines (73 loc) · 2.66 KB
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
/// <reference types="vitest" />
import { configDefaults } from 'vitest/config'
import { defineConfig } from 'vitest/config'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import ViteYaml from '@modyfi/vite-plugin-yaml'
import dts from 'vite-plugin-dts'
// https://vitejs.dev/config/
// https://stackoverflow.com/a/74397545/445757
export default defineConfig({
resolve: {
conditions: ['userfrosting:monorepo', 'import']
},
plugins: [
vue(),
ViteYaml(),
dts({
include: ['env.d.ts', 'app/assets/**/*.ts', 'app/assets/**/*.vue'],
exclude: ['app/assets/tests/**/*'],
outDir: 'dist',
copyDtsFiles: true,
rollupTypes: false,
compilerOptions: {
customConditions: ['userfrosting:monorepo']
}
})
],
build: {
lib: {
entry: {
index: resolve(import.meta.dirname, 'app/assets/index.ts'),
components: resolve(import.meta.dirname, 'app/assets/components/index.ts'),
composables: resolve(import.meta.dirname, 'app/assets/composables/index.ts'),
interfaces: resolve(import.meta.dirname, 'app/assets/interfaces/index.ts'),
routes: resolve(import.meta.dirname, 'app/assets/routes/index.ts'),
views: resolve(import.meta.dirname, 'app/assets/views/index.ts')
},
formats: ['es']
},
rollupOptions: {
external: [
'vue',
'vue-router',
'axios',
'pinia',
'pinia-plugin-persistedstate',
'limax',
'@userfrosting/sprinkle-core',
'@userfrosting/sprinkle-core/composables',
'@userfrosting/sprinkle-core/interfaces',
'@userfrosting/sprinkle-core/stores',
'@userfrosting/sprinkle-account',
'@userfrosting/sprinkle-account/composables',
'@userfrosting/sprinkle-account/guards',
'@userfrosting/sprinkle-account/interfaces',
'@userfrosting/sprinkle-account/stores'
],
output: {
preserveModules: false,
entryFileNames: '[name].js'
}
}
},
test: {
coverage: {
reportsDirectory: './_meta/_coverage',
include: ['app/assets/**/*.{js,jsx,ts,tsx,vue}'],
exclude: ['app/assets/**/.*', 'app/assets/**/*.md', 'app/assets/tests/**/*.*']
},
environment: 'happy-dom',
exclude: [...configDefaults.exclude, './vendor/**/*.*']
}
})