-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
80 lines (70 loc) · 1.94 KB
/
build.bat
File metadata and controls
80 lines (70 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@echo off
REM Script de compilación para Atomic Particles Simulation (Windows)
echo.
echo 🚀 Iniciando compilación del proyecto Rust + WASM
echo ==================================================
REM Verificar si Rust está instalado
where cargo >nul 2>nul
if errorlevel 1 (
echo ❌ Error: Rust no está instalado
echo Instálalo desde: https://rustup.rs
exit /b 1
)
REM Verificar si wasm-pack está instalado
where wasm-pack >nul 2>nul
if errorlevel 1 (
echo ❌ Error: wasm-pack no está instalado
echo Instalando con: cargo install wasm-pack
call cargo install wasm-pack
)
REM Verificar si Node.js está instalado
where node >nul 2>nul
if errorlevel 1 (
echo ❌ Error: Node.js no está instalado
echo Instálalo desde: https://nodejs.org
exit /b 1
)
echo ✅ Herramientas verificadas
echo.
REM Limpiar builds anteriores
echo 🧹 Limpiando builds anteriores...
if exist pkg rmdir /s /q pkg
if exist dist rmdir /s /q dist
echo ✓ Carpetas eliminadas
echo.
REM Compilar WASM
echo 🦀 Compilando Rust a WebAssembly...
call wasm-pack build src/rust --target bundler
if errorlevel 1 (
echo ❌ Error compilando WASM
exit /b 1
)
echo ✅ WASM compilado exitosamente
echo.
REM Instalar dependencias de Node
echo 📦 Instalando dependencias de Node...
call npm install
if errorlevel 1 (
echo ⚠️ Algunas dependencias podrían no haber sido instaladas
)
echo ✅ Dependencias instaladas
echo.
REM Compilar para producción
echo 🏗️ Compilando para producción...
call npm run build
if errorlevel 1 (
echo ❌ Error en el build de producción
exit /b 1
)
echo ✅ Build de producción completado
echo.
echo ==================================================
echo ✨ ¡Compilación completada!
echo.
echo 📁 Archivos generados en: .\dist\
echo 🌐 Sirve los archivos y abre index.html en el navegador
echo.
echo Para desarrollo con hot-reload:
echo npm run dev
echo.
pause