-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvite.config.js
49 lines (45 loc) · 1.01 KB
/
vite.config.js
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
/// <reference types="vitest" />
/// <reference types="vitest/globals" />
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
import { defineConfig } from 'vite'
// for Vue 3 use this:
import vue from '@vitejs/plugin-vue'
// for Vue 2 use this:
// import { createVuePlugin as vue } from 'vite-plugin-vue2'
const path = require('path')
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
optimizeDeps: {
include: [
'vue-demi'
]
},
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'vuejs-confirm-dialog',
fileName: (format) => `vuejs-confirm-dialog.${format}.js`,
},
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue',
},
},
},
commonjsOptions: {
include: [/vue-demi/, /node_modules/]
}
},
test: {
environment: 'happy-dom'
}
})