-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.lib.config.js
49 lines (45 loc) · 1.35 KB
/
vite.lib.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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue2';
import alias from '@rollup/plugin-alias'
import commonjs from '@rollup/plugin-commonjs'; // Convert CommonJS modules to ES6
import buble from '@rollup/plugin-buble'; // Transpile/polyfill with reasonable browser support
import { resolve } from 'path'
import libCss from 'vite-plugin-libcss';
const projectRootDir = resolve(__dirname);
export default defineConfig({
plugins: [
vue(),
libCss()
],
resolve: {
alias: {
'@': resolve(projectRootDir, 'src'),
},
},
build: {
lib: {
entry: resolve(__dirname, 'lib/index.js'),
name: '@zenetys/ztable',
fileName: 'ztable',
},
copyPublicDir: false,
cssCodeSplit: false,
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue', 'axios', 'vuetify'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue',
axios: 'axios',
vuetify: 'vuetify'
}
},
plugins: [
commonjs(),
],
}
}
});