-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.js
38 lines (36 loc) · 994 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
35
36
37
38
import vue from '@vitejs/plugin-vue';
import path from 'path';
/** @type {import('vite').UserConfig} */
export default {
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
base: './',
build: {
outDir: 'docs',
rollupOptions: {
output: {
entryFileNames: '[name].min.js',
assetFileNames: (entry) => {
if (entry.names[0].match(/\.svg$/)) {
return 'img/[name].min[extname]';
} else if (entry.names[0].match(/\.(ttf|otf|woff|woff2)?$/)) {
return 'fonts/[name][extname]';
}
return '[name][extname]';
},
},
},
},
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => ['data-box', 'bar-chart', 'bar-line-chart', 'gauge-chart', 'line-chart', 'map-chart', 'map-chart-reg', 'multiline-chart', 'pie-chart', 'radar-chart', 'scatter-chart', 'table-chart'].includes(tag),
},
},
}),
],
};