Commit 8da7e135 by 王宝涛

chore(config): 更新环境配置和构建设置

- 在 .env.test 中添加中文注释并修改默认配置值
- 将 docker-compose.yml 中的服务名从 vue-app 更改为 xjrsoft-vue
- 在 Dockerfile 中添加构建参数支持不同环境模式
- 在 package.json 中添加 production 构建脚本命令
parent 41092844
NODE_ENV=production
# Whether to open mock
# 是否开启mock
VITE_USE_MOCK = true
# public path
# 资源公共路径,需要以 / 开头和结尾
VITE_PUBLIC_PATH = /
# Delete console
# 是否删除Console.log
VITE_DROP_CONSOLE = true
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'none'
# 打包是否输出gz|br文件
# 可选: gzip | brotli | none
# 也可以有多个, 例如 ‘gzip’|'brotli',这样会同时生成 .gz和.br文件
VITE_BUILD_COMPRESS = 'gzip'
# Whether to delete origin files when using compress, default false
# 使用compress时是否删除源文件,默认false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
# 接口地址 可以由nginx做转发或者直接写实际地址
VITE_GLOB_API_URL=http://112.230.195.2:8053
# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=/upload
# 文件上传地址 可以由nginx做转发或者直接写实际地址
VITE_GLOB_UPLOAD_URL = /system/oss/upload
# 文件预览接口 可选
VITE_GLOB_UPLOAD_PREVIEW = http://114.116.210.204:8012/onlinePreview?url=
VITE_GLOB_UPLOAD_PREVIEW = http://112.230.195.2:9012/onlinePreview?url=
#外部url地址
VITE_GLOB_OUT_LINK_URL = http://localhost:4100,http://localhost:8827
VITE_GLOB_OUT_LINK_URL = http://vue.xjrsoft.com:3200
#打印项目地址
VITE_GLOB_PRINT_BASE_URL = http://114.116.210.204:3300
VITE_GLOB_PRINT_BASE_URL = https://vue.xjrsoft.com:7002
#IM URL 地址
VITE_GLOB_IM_LINK_URL = http://localhost:8827
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
#调查问卷地址
VITE_GLOB_QN_LINK_URL = https://vue.xjrsoft.com
# Whether to enable image compression
VITE_USE_IMAGEMIN= true
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
VITE_GLOB_API_URL_PREFIX =
# use pwa
# 打包是否开启pwa功能
VITE_USE_PWA = false
# Is it compatible with older browsers
VITE_LEGACY = false
# 是否启用官网代码
VITE_GLOB_PRODUCTION = true
# 帆软服务地址
VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075
......@@ -23,7 +23,8 @@ RUN pnpm install --frozen-lockfile
COPY . .
# 执行构建命令 (假设你的构建脚本是 build,输出到 dist 目录)
RUN pnpm run build
ARG BUILD_MODE=production
RUN pnpm run build:${BUILD_MODE}
# ==========================================
# 阶段 2: 生产环境 (Production)
......
services:
vue-app:
xjrsoft-vue:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_MODE: production
image: xjrsoft-vue:1.0.0
container_name: xjrsoft-vue
ports:
......
......@@ -11,6 +11,7 @@
"serve": "npm run dev",
"dev": "vite",
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts",
"build:production": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts",
"build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode test && esno ./build/script/postBuild.ts",
"build:no-cache": "pnpm clean:cache && npm run build",
"report": "cross-env REPORT=true npm run build",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment