10 changed files with 17 additions and 222 deletions
@ -1,53 +0,0 @@
@@ -1,53 +0,0 @@
|
||||
# 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 |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
@echo off |
||||
echo Starting GoFaster Frontend with Hot Reload... |
||||
echo. |
||||
echo Hot reload enabled - code changes will automatically rebuild and reload |
||||
echo Press Ctrl+C to stop |
||||
echo. |
||||
|
||||
npm run dev |
@ -1,7 +0,0 @@
@@ -1,7 +0,0 @@
|
||||
Write-Host "Starting GoFaster Frontend with Hot Reload..." -ForegroundColor Green |
||||
Write-Host "" |
||||
Write-Host "Hot reload enabled - code changes will automatically rebuild and reload" -ForegroundColor Yellow |
||||
Write-Host "Press Ctrl+C to stop" -ForegroundColor Yellow |
||||
Write-Host "" |
||||
|
||||
npm run dev |
@ -1,41 +0,0 @@
@@ -1,41 +0,0 @@
|
||||
@echo off |
||||
chcp 65001 >nul |
||||
setlocal enabledelayedexpansion |
||||
|
||||
echo Starting GoFaster development with stable configuration... |
||||
echo Setting environment variables... |
||||
|
||||
set VUE_CLI_BABEL_TRANSPILE_MODULES=false |
||||
set VUE_CLI_MODERN_BUILD=false |
||||
set NODE_ENV=development |
||||
|
||||
echo VUE_CLI_BABEL_TRANSPILE_MODULES: %VUE_CLI_BABEL_TRANSPILE_MODULES% |
||||
echo VUE_CLI_MODERN_BUILD: %VUE_CLI_MODERN_BUILD% |
||||
echo NODE_ENV: %NODE_ENV% |
||||
|
||||
echo Building Vue application... |
||||
call vue-cli-service build --mode development |
||||
|
||||
if %ERRORLEVEL% EQU 0 ( |
||||
echo Vue build successful, starting Electron... |
||||
echo Starting with stable configuration... |
||||
electron . --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage |
||||
) else ( |
||||
echo Vue build failed! |
||||
echo Attempting to clean and rebuild... |
||||
|
||||
echo Cleaning dist directory... |
||||
if exist dist rmdir /s /q dist |
||||
|
||||
echo Rebuilding Vue application... |
||||
call vue-cli-service build --mode development |
||||
|
||||
if %ERRORLEVEL% EQU 0 ( |
||||
echo Rebuild successful, starting Electron... |
||||
electron . --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage |
||||
) else ( |
||||
echo Rebuild failed! Please check your code for errors. |
||||
pause |
||||
exit /b 1 |
||||
) |
||||
) |
@ -1,57 +0,0 @@
@@ -1,57 +0,0 @@
|
||||
# 前端启动脚本 - 解决中文编码问题 |
||||
param( |
||||
[switch]$Debug, |
||||
[switch]$Watch |
||||
) |
||||
|
||||
# 强制设置控制台编码 |
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 |
||||
[Console]::InputEncoding = [System.Text.Encoding]::UTF8 |
||||
$OutputEncoding = [System.Text.Encoding]::UTF8 |
||||
|
||||
# 设置环境变量 |
||||
$env:VUE_CLI_BABEL_TRANSPILE_MODULES = "false" |
||||
$env:VUE_CLI_MODERN_BUILD = "false" |
||||
$env:VUE_CLI_LOG_LEVEL = "info" |
||||
$env:VUE_CLI_DEBUG = "true" |
||||
$env:LANG = "zh_CN.UTF-8" |
||||
$env:LC_ALL = "zh_CN.UTF-8" |
||||
$env:NODE_OPTIONS = "--max-old-space-size=4096" |
||||
$env:CHROME_BIN = "C:\Program Files\Google\Chrome\Application\chrome.exe" |
||||
|
||||
# Windows 特定编码设置 |
||||
$env:PYTHONIOENCODING = "utf-8" |
||||
$env:PYTHONLEGACYWINDOWSSTDIO = "utf-8" |
||||
|
||||
Write-Host "Starting Frontend Development Environment (UTF-8 Optimized)..." -ForegroundColor Cyan |
||||
Write-Host "Encoding: UTF-8" -ForegroundColor Green |
||||
Write-Host "Log Level: INFO" -ForegroundColor Green |
||||
Write-Host "Hot Reload: Enabled" -ForegroundColor Green |
||||
Write-Host "" |
||||
|
||||
# Select startup mode |
||||
$script = if ($Debug) { "npm run dev:debug" } elseif ($Watch) { "npm run dev:watch" } else { "npm run dev" } |
||||
|
||||
Write-Host "Startup Command: $script" -ForegroundColor Yellow |
||||
Write-Host "" |
||||
|
||||
# Start frontend |
||||
try { |
||||
Invoke-Expression $script |
||||
} catch { |
||||
Write-Host "Startup failed: $($_.Exception.Message)" -ForegroundColor Red |
||||
Write-Host "Trying fallback startup method..." -ForegroundColor Yellow |
||||
|
||||
# Fallback startup method |
||||
if ($Debug) { |
||||
npm run dev:debug |
||||
} elseif ($Watch) { |
||||
npm run dev:watch |
||||
} else { |
||||
npm run dev |
||||
} |
||||
} |
||||
|
||||
Write-Host "" |
||||
Write-Host "Press any key to exit..." |
||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") |
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
@echo off |
||||
chcp 65001 >nul |
||||
setlocal enabledelayedexpansion |
||||
|
||||
echo Starting GoFaster development with UTF-8 encoding... |
||||
echo Setting environment variables... |
||||
|
||||
set VUE_CLI_BABEL_TRANSPILE_MODULES=false |
||||
set VUE_CLI_MODERN_BUILD=false |
||||
|
||||
echo VUE_CLI_BABEL_TRANSPILE_MODULES: %VUE_CLI_BABEL_TRANSPILE_MODULES% |
||||
echo VUE_CLI_MODERN_BUILD: %VUE_CLI_MODERN_BUILD% |
||||
|
||||
echo Building Vue application... |
||||
call vue-cli-service build --mode development |
||||
|
||||
if %ERRORLEVEL% EQU 0 ( |
||||
echo Vue build successful, starting Electron... |
||||
electron . |
||||
) else ( |
||||
echo Vue build failed! |
||||
pause |
||||
exit /b 1 |
||||
) |
@ -1,25 +0,0 @@
@@ -1,25 +0,0 @@
|
||||
# PowerShell开发脚本 - 设置正确的编码 |
||||
# 设置控制台编码为UTF-8 |
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 |
||||
[Console]::InputEncoding = [System.Text.Encoding]::UTF8 |
||||
|
||||
# 设置环境变量 |
||||
$env:VUE_CLI_BABEL_TRANSPILE_MODULES = "false" |
||||
$env:VUE_CLI_MODERN_BUILD = "false" |
||||
|
||||
Write-Host "Starting GoFaster development with UTF-8 encoding..." -ForegroundColor Green |
||||
Write-Host "VUE_CLI_BABEL_TRANSPILE_MODULES: $env:VUE_CLI_BABEL_TRANSPILE_MODULES" -ForegroundColor Yellow |
||||
Write-Host "VUE_CLI_MODERN_BUILD: $env:VUE_CLI_MODERN_BUILD" -ForegroundColor Yellow |
||||
|
||||
# 构建Vue应用 |
||||
Write-Host "Building Vue application..." -ForegroundColor Cyan |
||||
npm run build:vue |
||||
|
||||
if ($LASTEXITCODE -eq 0) { |
||||
Write-Host "Vue build successful, starting Electron..." -ForegroundColor Green |
||||
# 启动Electron |
||||
electron . |
||||
} else { |
||||
Write-Host "Vue build failed!" -ForegroundColor Red |
||||
exit 1 |
||||
} |
@ -1 +1 @@
@@ -1 +1 @@
|
||||
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1 |
||||
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1 |
Loading…
Reference in new issue