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.
 
 
 
 
 
 

53 lines
2.0 KiB

# GoFaster Enhanced Hot Reload Script
# 增强版热重载脚本,确保前端代码变化时能够实时刷新
Write-Host "Starting GoFaster Frontend with Enhanced Hot Reload..." -ForegroundColor Green
Write-Host ""
Write-Host "Enhanced hot reload enabled with the following features:" -ForegroundColor Yellow
Write-Host " ✓ Vue.js watch mode for automatic rebuilds" -ForegroundColor Cyan
Write-Host " ✓ Electron reload on file changes" -ForegroundColor Cyan
Write-Host " ✓ Concurrent build and electron processes" -ForegroundColor Cyan
Write-Host " ✓ File change detection and auto-reload" -ForegroundColor Cyan
Write-Host ""
Write-Host "Code changes will automatically:" -ForegroundColor White
Write-Host " 1. Trigger Vue.js rebuild" -ForegroundColor White
Write-Host " 2. Reload Electron window" -ForegroundColor White
Write-Host " 3. Apply changes immediately" -ForegroundColor White
Write-Host ""
Write-Host "Press Ctrl+C to stop" -ForegroundColor Yellow
Write-Host ""
# 检查依赖
Write-Host "Checking dependencies..." -ForegroundColor Yellow
if (-not (Test-Path "node_modules")) {
Write-Host "Dependencies not installed, installing..." -ForegroundColor Yellow
npm install
if ($LASTEXITCODE -ne 0) {
Write-Host "Dependency installation failed" -ForegroundColor Red
exit 1
}
}
# 检查必要的包
$concurrentlyInstalled = npm list concurrently 2>$null
$waitOnInstalled = npm list wait-on 2>$null
if (-not $concurrentlyInstalled) {
Write-Host "Installing concurrently..." -ForegroundColor Yellow
npm install --save-dev concurrently
}
if (-not $waitOnInstalled) {
Write-Host "Installing wait-on..." -ForegroundColor Yellow
npm install --save-dev wait-on
}
Write-Host "Dependencies check completed" -ForegroundColor Green
Write-Host ""
# 启动增强版热重载
Write-Host "Starting enhanced hot reload..." -ForegroundColor Green
Write-Host "This will run: npm run dev:watch" -ForegroundColor Cyan
Write-Host ""
npm run dev:watch