-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
executable file
·52 lines (45 loc) · 1.25 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
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import checker from 'vite-plugin-checker';
import dts from 'vite-plugin-dts';
import { libInjectCss } from 'vite-plugin-lib-inject-css'
import pkg from './package.json' ;
const name = 'PlusAuthWidget';
export default defineConfig(({ command }) => ({
define: command === 'build' ? {
'process.env': { NODE_ENV: 'production' }
}: {},
build: {
target: [
'chrome109', 'edge114', 'firefox114', 'ios14.5', 'safari11'
],
lib: {
formats: ['es', 'umd'],
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'src/index.ts'),
name,
// the proper extensions will be added
fileName: (format) => (format === 'es' ? pkg.module : pkg.main).split('/').at(1) as string,
},
},
plugins: [
vue({}),
libInjectCss(),
dts({ outDir: 'dist/types' }),
// checker({
// vueTsc: true
// })
],
resolve: {
dedupe: ['vue'],
},
optimizeDeps: {
include: [
'@popperjs/core/lib/modifiers/offset',
'@popperjs/core/lib/modifiers/flip',
'@popperjs/core/lib/modifiers/preventOverflow',
'@popperjs/core/lib/popper-lite'
]
}
}))