You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.3 KiB

@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
REM 增强版开发脚本 - 解决中文编码和日志问题
echo 🚀 启动 GoFaster 前端开发环境...
echo 📝 编码设置: UTF-8
echo 🔧 日志级别: INFO
echo ⚡ 热重载: 已启用
echo.
REM 设置环境变量
set VUE_CLI_BABEL_TRANSPILE_MODULES=false
set VUE_CLI_MODERN_BUILD=false
set VUE_CLI_LOG_LEVEL=info
set VUE_CLI_DEBUG=true
set LANG=zh_CN.UTF-8
set LC_ALL=zh_CN.UTF-8
set NODE_OPTIONS=--max-old-space-size=4096
REM 检查依赖
echo 📦 检查依赖...
if not exist "node_modules" (
echo 依赖未安装,正在安装...
call npm install
if errorlevel 1 (
echo ❌ 依赖安装失败
pause
exit /b 1
)
)
REM 安装 cross-env(如果不存在)
call npm list cross-env >nul 2>&1
if errorlevel 1 (
echo 📦 安装 cross-env...
call npm install --save-dev cross-env
)
echo ✅ 依赖检查完成
echo.
REM 启动服务
echo 🚀 标准模式启动...
echo 执行命令: npm run dev
echo.
call npm run dev
if errorlevel 1 (
echo.
echo ❌ 启动失败
echo.
echo 🔧 故障排除:
echo 1. 检查 Node.js 版本 (推荐 v16+)
echo 2. 清除 node_modules 并重新安装
echo 3. 检查端口占用情况
echo 4. 查看详细错误日志
pause
exit /b 1
)
pause