-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
29 lines (27 loc) · 854 Bytes
/
vite.config.ts
File metadata and controls
29 lines (27 loc) · 854 Bytes
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
import { fileURLToPath } from 'node:url'
import type { UserConfig } from 'vite-plus'
import { defineConfig, loadEnv } from 'vite-plus'
import { loadPlugins } from './plugins'
import { loadAlias } from './plugins/alias'
import { loadBuild } from './plugins/build'
import { loadSever } from './plugins/server'
const baseUrl = fileURLToPath(new URL('./', import.meta.url))
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, baseUrl)
return {
base: env.VITE_BASE_PATH ?? '/',
plugins: loadPlugins(mode, baseUrl),
resolve: {
alias: loadAlias(baseUrl),
},
server: loadSever(mode, baseUrl),
// devtools: {
// enabled: true,
// },
build: loadBuild(),
staged: {
'*.{js,ts,tsx,vue,json,css,less,sass,scss,md}': 'vp check --fix',
},
} as UserConfig
})