-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.js
58 lines (57 loc) · 1.65 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
54
55
56
57
58
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import svgLoader from 'vite-svg-loader';
import dts from 'vite-plugin-dts';
import * as path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/main.ts'),
name: 'ui-components',
fileName: (format) => `ui-components.${format}.js`
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue', /primevue\/.+/],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue'
}
},
resolve: {
dedupe: ['vue']
}
}
},
plugins: [vue(), svgLoader(), dts()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
},
dedupe: ['vue'],
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: 'setupTests.js',
coverage: {
include: ['src/**/*.{js,ts,vue}'],
exclude: [
'src/**/index.{js,ts}', // No need to cover index files for exports
'src/main.ts', // No need to cover bootstrap file
'src/**/*.spec.{js,ts}', // No need to cover test files
'src/**/*.stories.{js,ts}', // No need to cover stories files
'src/theme/**', // No need to cover components just for showing theming
'src/components/Icons/**' // No need to cover components just for rendering svg icons
],
branches: 80,
functions: 80,
lines: 80
}
}
});