-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
52 lines (50 loc) · 1.19 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
51
52
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path"
import WindiCSS from 'vite-plugin-windicss'
import Icons from 'unplugin-icons/vite'
import IconsResolver from 'unplugin-icons/resolver'
import Components from 'unplugin-vue-components/vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
WindiCSS(),
Components({
resolvers: IconsResolver(),
}),
Icons(),
vueJsx()
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
fs: {
// Allow serving files from one level up to the project root
allow: ['..']
}
},
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'VueSweetforms',
fileName: (format) => `vue-sweetforms.${format}.js`
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue',
},
},
},
},
})