chore: 调整开发预览其他环境的配置文件

This commit is contained in:
wangxuefeng
2025-03-13 11:34:10 +08:00
parent f0d3380b6c
commit a15d6ec6c3
17 changed files with 146 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
# 只在生产模式中被载入
VITE_NODE_ENV = 'development'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
VITE_PORT = 10011
VITE_DEBUG_MODE = true
VITE_PLATFORM_URL = 'https://localhost:10010/'
VITE_DESIGNER_URL = 'https://localhost:10011/'
VITE_RENDERER_URL = 'https://localhost:10012/'

View File

@@ -0,0 +1,16 @@
# 只在预发布模式中被载入
VITE_NODE_ENV = 'development'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# base api url
VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
VITE_PORT = 10011
VITE_DEBUG_MODE = true
VITE_PLATFORM_URL = 'https://localhost:10010/'
VITE_DESIGNER_URL = 'https://localhost:10011/'
VITE_RENDERER_URL = 'https://localhost:10012/'

View File

@@ -4,14 +4,12 @@ VITE_NODE_ENV = 'development'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# 前端可见变量(必须以 VITE_ 开头)
VITE_PORT = 10011
# VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
VITE_DEBUG_MODE = true
VITE_PLATFORM_URL = 'https://localhost:10010/'
VITE_DESIGNER_URL = 'https://localhost:10011/'
VITE_RENDERER_URL = 'https://localhost:10012/'

View File

@@ -6,8 +6,8 @@
"type": "module",
"scripts": {
"dev": "vite --mode development",
"dev:staging": "vite --mode staging",
"dev:prod": "vite --mode production",
"dev:staging": "vite --mode dev-staging",
"dev:prod": "vite --mode dev-production",
"build": "vite build --mode production",
"build:staging": "vite build --mode staging",
"build:dev": "vite build --mode development",

View File

@@ -36,7 +36,7 @@ export default defineConfig(({ mode }) => {
...config,
server: {
https: true,
port: Number(env.VITE_PORT),
port: isDev ? Number(env.VITE_PORT) : undefined,
host: true
},
define: {