-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.packages.config.js
54 lines (52 loc) · 1.5 KB
/
vite.packages.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
50
51
52
53
54
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
export default defineConfig({
plugins: [vue(), vueJsx()],
build: {
outDir: resolve(__dirname, './packages'),
minify: false,
rollupOptions: {
exports: 'named',
external: [
'vue',
'ant-design-vue',
'@ant-design/icons-vue',
'dayjs',
'lodash-es'
],
// output: [
// {
// format: 'es',
// entryFileNames: '[name].mjs',
// preserveModules: true,
// exports: 'named',
// dir: './packages/components',
// }
// ]
},
lib: {
entry: resolve(__dirname, './entry.packages.js'),
name: 'packages',
fileName: 'index',
formats: ['es']
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@import \'@/css/mixin.scss\';@import \'@/css/theme.scss\';'
}
}
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'@site-pro': resolve(__dirname, 'packages')
}
}
})