-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.lib.ts
49 lines (48 loc) · 1.19 KB
/
vite.config.lib.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
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vuetify from 'vite-plugin-vuetify'
import dts from 'vite-plugin-dts'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { fileURLToPath, URL } from 'url'
export default defineConfig({
build: {
sourcemap: true,
lib: {
entry: path.resolve(__dirname, 'src/lib.ts'),
name: 'CommonAdmin',
fileName: (format) => `common-admin.${format}.js`,
formats: ['es'],
},
rollupOptions: {
external: [
'vue',
/^vuetify(\/.*)?$/,
'axios',
'pinia',
'vue-i18n',
'vue-router',
'@vuelidate/core',
'@vuelidate/validators',
'@vueuse/core',
'@vueuse/integrations',
'socket.io-client',
],
},
},
plugins: [
vue(),
vuetify({ autoImport: true }),
VueI18nPlugin({
globalSFCScope: true,
runtimeOnly: false,
include: path.resolve(__dirname, 'src/locales/**.json'),
}),
dts({ rollupTypes: true, tsconfigPath: 'tsconfig.libdts.json' }),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})