-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
37 lines (35 loc) · 968 Bytes
/
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
import { resolve } from 'node:path'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import eslintPlugin from 'vite-plugin-eslint'
import { createHtmlPlugin } from 'vite-plugin-html'
const BASE_PATH = '/'
const CLIENT_PUBLIC_ENV_PREFIX = 'PUBLIC_'
const ROOT_DIR_PATH = resolve(__dirname, 'src')
const PUBLIC_ASSETS_DIR_PATH = resolve(__dirname, 'static')
const OUTPUT_DIR_PATH = resolve(__dirname, 'dist')
const ENV_DIR_PATH = __dirname
export default defineConfig(() => {
return {
root: ROOT_DIR_PATH,
publicDir: PUBLIC_ASSETS_DIR_PATH,
envDir: ENV_DIR_PATH,
envPrefix: CLIENT_PUBLIC_ENV_PREFIX,
base: BASE_PATH,
build: {
outDir: OUTPUT_DIR_PATH,
emptyOutDir: true,
manifest: true,
},
plugins: [
react(),
eslintPlugin(),
createHtmlPlugin({
minify: true,
}),
],
resolve: {
alias: [{ find: '~', replacement: ROOT_DIR_PATH }],
},
}
})