-
Notifications
You must be signed in to change notification settings - Fork 10
/
vite.config.ts
42 lines (41 loc) · 923 Bytes
/
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
/// <reference types="vitest" />
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
lib: {
entry: fileURLToPath(new URL('./src/index.ts', import.meta.url)),
name: 'VueComixable',
formats: ['es', 'cjs', 'iife'],
fileName: (format) => {
switch (format) {
case 'es':
return 'index.mjs'
case 'cjs':
return 'index.cjs'
case 'iife':
return 'index.js'
default:
return 'index.js'
}
},
},
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue',
},
},
},
},
test: {
setupFiles: ['./src/__tests__/setup.ts'],
},
})