-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
53 lines (48 loc) · 1.37 KB
/
vite.config.js
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
const fs = require('fs')
const path = require('path')
const vue = require('@vitejs/plugin-vue');
/**
* @type {import('vite').UserConfig}
*/
module.exports = {
build: {
// See https://vitejs.dev/guide/build.html#library-mode
lib: {
entry: path.resolve(__dirname, 'src/main.js'),
name: 'SDComponents'
},
// Leaving this unminified so you can see what exactly gets included in
// the bundles
minify: false,
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue'],
// Provide global variables to use in the UMD build
// for externalized deps
output: {
globals: {
vue: 'Vue'
}
}
}
},
plugins: [
// Explicitly emit an index.html file for demo purposes
{
name: 'emit-index',
generateBundle() {
this.emitFile({
type: 'asset',
fileName: 'index.html',
source: fs.readFileSync(
path.resolve(__dirname, 'index.dist.html'),
'utf-8'
)
})
}
},
// Vite Vue SFC plugin
vue()
]
}