-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
publish.config.ts
38 lines (37 loc) · 999 Bytes
/
publish.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
import vue from '@vitejs/plugin-vue'
import * as path from 'path'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
export default defineConfig({
plugins: [vue(), dts()],
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'BikeTag',
formats: ['es', 'umd'],
fileName: (format) => `biketag-vue.${format}.js`,
},
rollupOptions: {
external: ['vue', 'vue-router', 'pinia', 'biketag'],
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') return 'biketag-vue.css'
return assetInfo.name!
},
// disable warning on src/index.ts using both default and named export
exports: 'named',
globals: {
vue: 'Vue',
pinia: 'pinia',
biketag: 'BikeTagClient',
'vue-router': 'vueRouter',
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
})