-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
24 lines (22 loc) · 811 Bytes
/
Copy pathvite.config.ts
File metadata and controls
24 lines (22 loc) · 811 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import packageJson from './package.json'
export default defineConfig(({ mode }) => {
const isCapacitorBuild = process.env.CAPACITOR_BUILD === 'true'
const isTossBuild = process.env.VITE_PLATFORM === 'toss'
const isDebugBuild = mode === 'development'
return {
define: {
__APP_VERSION__: JSON.stringify(packageJson.version),
__DEV_BUILD__: JSON.stringify(isDebugBuild),
__PLATFORM__: JSON.stringify(isTossBuild ? 'toss' : 'default'),
},
plugins: [react()],
base: isCapacitorBuild ? './' : '/',
build: {
outDir: 'dist',
minify: isDebugBuild ? false : 'esbuild',
sourcemap: isDebugBuild,
},
}
})