forked from charliekassel/vuejs-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
34 lines (33 loc) · 906 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
33
34
const path = require('path');
const { defineConfig } = require('vite');
const vue = require('@vitejs/plugin-vue');
module.exports = defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
root: path.resolve(__dirname, 'example'),
plugins: [ vue() ],
build: {
lib: {
entry: path.resolve(__dirname, 'src', 'components', 'Datepicker.vue'),
name: 'vuejsDatepicker',
filename: (format) => `vuejs-datepicker.${format}.js`,
formats: [ 'umd', 'cjs', 'es' ],
},
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',
},
dir: path.resolve(__dirname, 'dist'),
},
},
},
});