forked from JetBrains/ij-perf-report-aggregator
/
vite.config.ts
69 lines (66 loc) · 1.97 KB
/
vite.config.ts
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
59
60
61
62
63
64
65
66
67
68
69
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import path from "path"
import vue from "@vitejs/plugin-vue"
import { ElementPlusResolver } from "unplugin-vue-components/resolvers"
import { defineConfig } from "vite"
import AutoImport from "unplugin-auto-import/vite"
import Components from "unplugin-vue-components/vite"
// import visualizer from "rollup-plugin-visualizer"
// https://vitejs.dev/config/
// noinspection SpellCheckingInspection,TypeScriptUnresolvedVariable
export default defineConfig({
plugins: [
// {
// ...eslintPlugin({
// include: ["dashboard/**/*.ts", "jb/dashboard/jb/**/*.vue"],
// cache: false,
// }),
// enforce: "pre",
// },
vue(),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
root: "dashboard/app",
publicDir: "dashboard/app/public",
server: {
host: "localhost",
port: 8080,
},
build: {
// sourcemap: true,
emptyOutDir: true,
chunkSizeWarningLimit: 600,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
outDir: path.resolve(__dirname, "cmd/frontend/kodata"),
rollupOptions: {
// plugins: [visualizer({filename: "/Volumes/data/foo/s.html"})],
// output: {
// manualChunks: {
// // element-plus is used in various chunks (because pages are loaded dynamically)
// echarts: ["echarts"],
// vue: ["vue"],
// }
// },
},
},
})
// export function ElementPlusResolver(): ComponentResolver {
// return (name: string) => {
// if (name.match(/^El[A-Z]/)) {
// // ElTableColumn -> table-column
// const partialName = kebabCase(name.slice(2))
// return {
// importName: name,
// path: "element-plus/es",
// sideEffects: `element-plus/theme-chalk/src/${partialName == "sub-menu" ? "submenu" : partialName}.scss`,
// }
// }
// }
// }