forked from Efficy/bootstrap-vue-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
74 lines (67 loc) · 2.01 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/// <reference types="vitest" />
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'
import visualizer from 'rollup-plugin-visualizer'
import dts from 'vite-plugin-dts'
const config = defineConfig({
build: {
minify: true,
lib: {
entry: resolve(__dirname, 'src/BootstrapVue.ts'),
name: 'bootstrap-vue-3',
fileName: (format) => `bootstrap-vue-3.${format}.js`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: [
'bootstrap',
'bootstrap/js/dist/alert',
'bootstrap/js/dist/collapse',
'bootstrap/js/dist/modal',
'bootstrap/js/dist/offcanvas',
'bootstrap/js/dist/popover',
'bootstrap/js/dist/carousel',
'bootstrap/js/dist/dropdown',
'bootstrap/js/dist/tooltip',
'vue',
],
output: {
exports: 'named',
assetFileNames: `bootstrap-vue-3.[ext]`, //without this, it generates build/styles.css
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
'vue': 'Vue',
'bootstrap': 'Bootstrap',
'bootstrap/js/dist/collapse': 'Collapse',
'bootstrap/js/dist/alert': 'Alert',
'bootstrap/js/dist/carousel': 'Carousel',
'bootstrap/js/dist/dropdown': 'Dropdown',
'bootstrap/js/dist/modal': 'Modal',
'bootstrap/js/dist/offcanvas': 'Offcanvas',
'bootstrap/js/dist/popover': 'Popover',
'bootstrap/js/dist/tooltip': 'Tooltip',
},
},
},
},
css: {preprocessorOptions: {scss: {charset: false}}},
plugins: [
vue({
include: [/\.vue$/, /\.md$/],
}),
visualizer(), // generates admin/stats.html on npm run build
dts(),
],
server: {
host: 'localhost', //this is the default
port: 8080, //this is the default
},
test: {
// globals: true,
environment: 'jsdom',
},
})
export default config