Files
vf_react/.env.development
zdl e9b54ce10d feat: package.json 优化方案
主要改动: 配置本地开发环境 PostHog 上报到 Cloud\

     1. 修改 npm start 默认行为
       - start → 使用 .env.mock (默认 mock 数据)
       - 添加 start:real → 使用 .env.local (真实后端)
     2. 添加 PostHog 测试脚本
       - 新增 test:tracking → 启用 PostHog debug 模式 + mock 数据
     3. 清理冗余脚本
       - 移除 start:local (冗余,只是调用 npm start)
       - 重命名 install:clean → reinstall (移除自动启动)
       - 添加 dev 快捷命令 (等同于 npm start)
       - 添加 clean 命令 (只清理,不安装)
     4. 优化 NODE_OPTIONS
       - 不在每个命令中重复,通过注释说明可以提取为环境变量
       - 保持 exit 0 在 lint 命令中
2025-10-29 16:00:21 +08:00

28 lines
748 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 开发环境配置(连接真实后端)
# 使用方式: npm run start:dev
# React 构建优化配置
GENERATE_SOURCEMAP=false
SKIP_PREFLIGHT_CHECK=true
DISABLE_ESLINT_PLUGIN=true
TSC_COMPILE_ON_ERROR=true
IMAGE_INLINE_SIZE_LIMIT=10000
NODE_OPTIONS=--max_old_space_size=4096
# API 配置
# 后端 API 地址(开发环境会代理到这个地址)
REACT_APP_API_URL=http://49.232.185.254:5001
# 禁用 Mock 数据使用真实API
REACT_APP_ENABLE_MOCK=false
# 开发环境标识
REACT_APP_ENV=development
# PostHog 配置(开发环境)
# 留空 = 仅控制台 debug
# 填入 Key = 控制台 + PostHog Cloud 双模式
REACT_APP_POSTHOG_KEY=
REACT_APP_POSTHOG_HOST=https://app.posthog.com
REACT_APP_ENABLE_SESSION_RECORDING=false