-
Notifications
You must be signed in to change notification settings - Fork 19
/
vite.config.mts
50 lines (48 loc) · 1.14 KB
/
vite.config.mts
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
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { UserConfig, defineConfig } from 'vite'
import svgLoader from 'vite-svg-loader'
// eslint-disable-next-line import/no-default-export
export default defineConfig(() => {
const baseConfig = {
resolve: {
alias: [
{
find: '@',
replacement: resolve(__dirname, 'src'),
},
],
},
plugins: [vue(), svgLoader()],
test: {
globals: true,
environment: 'jsdom',
},
build: {
emptyOutDir: false,
sourcemap: true,
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'prefect-ui-library',
},
rollupOptions: {
external: [
'vue',
'vue-router',
'vee-validate',
'@prefecthq/vue-compositions',
'@prefecthq/prefect-design',
'@prefecthq/vue-charts',
],
output: {
exports: 'named',
// Provide vue as a global variable to use in the UMD build
globals: {
vue: 'Vue',
},
},
},
},
} satisfies UserConfig
return baseConfig
})