generated from innei-template/vite-react-tailwind-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
49 lines (46 loc) · 1.22 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
import reactRefresh from '@vitejs/plugin-react'
import { cyan, dim, green } from 'kolorist'
import { RemoveWrapperFunction } from 'unplugin-ast/transformers'
import AST from 'unplugin-ast/vite'
import type { PluginOption, ViteDevServer } from 'vite'
import { defineConfig } from 'vite'
import { checker } from 'vite-plugin-checker'
import tsconfigPaths from 'vite-tsconfig-paths'
import PKG from './package.json'
const devPrint = (): PluginOption => ({
name: 'dev-print',
configureServer(server: ViteDevServer) {
const _printUrls = server.printUrls
server.printUrls = () => {
_printUrls()
console.info(
` ${green('➜')} ${dim('Online debug')}: ${cyan(
'https://linear.innei.in/__debug_proxy',
)}`,
)
}
},
})
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
reactRefresh(),
tsconfigPaths(),
// MillionLint.vite({}),
checker({
typescript: true,
enableBuild: true,
}),
AST({
transformer: [RemoveWrapperFunction(['tw', 'defineSettingPageData'])],
}),
devPrint(),
],
server: {
port: 7123,
},
define: {
APP_DEV_CWD: JSON.stringify(process.cwd()),
APP_NAME: JSON.stringify(PKG.name),
},
})