-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathvite.config.js
32 lines (30 loc) · 884 Bytes
/
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
const path = require('path')
import vue from '@vitejs/plugin-vue'
const isLibMode = process.argv.includes("--mode=lib");
module.exports = {
build: {
...(isLibMode ? {
lib: {
entry: path.resolve(__dirname, 'lib/index.js'),
name: 'vue-displacement-slideshow',
formats: ['es', 'umd'],
fileName: format => `vue-displacement-slideshow.${format}.js`
}
} : {}),
rollupOptions: {
...(!isLibMode ? {
input: {
app: path.resolve(__dirname, 'index.html')
}
} : {}),
external: ['vue'],
output: {
globals: {
vue: 'Vue'
}
}
},
outDir: isLibMode ? "dist/lib" : "dist/app"
},
plugins: [vue()]
}