-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.build.config.ts
47 lines (47 loc) · 1.04 KB
/
vite.build.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
import { defineConfig } from 'vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
import dts from 'vite-plugin-dts'
export default defineConfig({
plugins: [
vueJsx(),
dts({
outputDir: ['es', 'lib'],
include: ['components/**/*.ts', 'components/**/*.tsx']
})
],
build: {
minify: false,
rollupOptions: {
external: [
'@ant-design/colors',
/^@ant-design\/icons-vue/,
'@antd-tiny-vue/cssinjs',
'@ctrl/tinycolor',
'@v-c/utils',
'@vueuse/core',
'vue'
],
output: [
{
format: 'es',
dir: 'es',
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: 'components'
},
{
format: 'cjs',
dir: 'lib',
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: 'components',
exports: 'named'
}
]
},
lib: {
entry: 'components/index.ts',
formats: ['es', 'cjs']
}
}
})