-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
88 lines (82 loc) · 2.1 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { fileURLToPath, URL } from 'node:url'
import { defineConfig, PluginOption } from 'vite'
import type { ViteDevServer } from 'vite'
import vue from '@vitejs/plugin-vue'
import veauryVitePlugins from 'veaury/vite/index.js'
// import history from "connect-history-api-fallback";
export default defineConfig({
plugins: [
// vue({
// template: {
// compilerOptions: {
// isCustomElement: (tag) => ['ion-icon'].includes(tag),
// },
// },
// }),
veauryVitePlugins({
type: 'vue',
vueOptions: {
template: {
compilerOptions: {
isCustomElement(tag: string) { return ['ion-icon'].includes(tag) }
},
},
},
}),
// (() => {
// // https://github.com/vitejs/vite/issues/2190
// return {
// name: 'rewrite-all',
// configureServer(server: ViteDevServer) {
// const handler = history({
// disableDotRule: true,
// rewrites: [{from: /\/$/, to: () => "/index.html"}]
// });
// server.middlewares.use((req, res, next) => {
// handler(req, res, next)
// });
// }
// }
// })()
// (function filterStdImportsPlugin(): PluginOption {
// /**
// * Inserts file contents into the module tree for specified import paths. This fixes
// * issues on Vite halting when it encounters Deno-specific import paths. Code inspired
// * from alex-kinokon/rollup-plugin-ignore.
// */
// const defaultFileContent = 'export default {}'
// const placeholderFilename = '\0__rollup_plugin_filter_placeholder__\0'
// return {
// name: 'filter-std-imports',
// resolveId(source: string | undefined) {
// if (source?.startsWith('std/')) {
// return placeholderFilename
// }
// return null
// },
// load(id: string) {
// if (id === placeholderFilename) {
// return defaultFileContent
// }
// return null
// },
// }
// })(),
],
server: {
port: 15_801,
proxy: {
'^/(api|trpc)': {
target: 'http://localhost:15800',
},
},
},
build: {
target: 'ES2021',
},
resolve: {
alias: {
'@client': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})