-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
50 lines (46 loc) · 1.27 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import banner from 'vite-plugin-banner'
import tailwindcss from '@tailwindcss/vite'
import options from './build/options'
import { fileURLToPath, URL } from 'url'
export default defineConfig(({ mode }) => {
const outDir = options.paths.output.main
return {
plugins: [
vue(),
tailwindcss(),
banner({ content: options.banner, outDir })
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
vue: 'vue/dist/vue.esm-bundler.js'
}
},
build: {
minify: mode === 'production' ? 'esbuild' : false,
outDir,
emptyOutDir: true,
chunkSizeWarningLimit: 600,
cssCodeSplit: false,
lib: {
entry: options.paths.resolve('src/index.ts'),
name: 'PersonizelyUI',
formats: ['umd', 'es'],
fileName: options.name
},
rollupOptions: {
external: [/^vue$/, 'vee-validate'],
output: {
globals: {
vue: 'Vue',
'vee-validate': 'veeValidate'
},
assetFileNames: assetInfo =>
assetInfo.name?.endsWith('.css') ? `${options.name}.css` : assetInfo.name || '[name][extname]'
}
}
}
}
})