feat: 앱인토스 토스판 빌드(보기 전용, 위치·공유 SDK 분기, appName nalssigak)
This commit is contained in:
1 parent
1fa0695c84
commit
7451599727
16 files changed
+1704
-58
No files matched your search
+15
-3
@@ -1,8 +1,20 @@
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
|
||||
// 토스 빌드는 토스 도메인에서 열리므로 API·사이트 주소를 HTTPS 절대 주소로 받아야 한다
|
||||
function checkTossEnv(mode: string) {
|
||||
if (mode !== 'toss') return
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
for (const key of ['VITE_API_BASE_URL', 'VITE_SITE_URL']) {
|
||||
if (!env[key]?.startsWith('https://')) throw new Error(`토스 빌드: ${key} 에 https:// 주소가 필요해요 (frontend/.env.toss)`)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
export default defineConfig(({ mode }) => {
|
||||
checkTossEnv(mode)
|
||||
return {
|
||||
plugins: [react(), tailwindcss()],
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user