PozoAppCommonUpdatedCode/COPY-NODE-MODULES-TO-DIST.bat

54 lines
1.2 KiB
Batchfile
Raw Normal View History

2025-12-05 09:45:16 +05:30
@echo off
REM Copy node_modules to dist folder for IIS deployment
REM This is required for iisnode to find dependencies
echo ========================================
echo COPYING NODE_MODULES TO DIST
echo ========================================
echo.
if not exist "node_modules" (
echo [ERROR] node_modules folder not found!
echo Please run 'npm install' first
pause
exit /b 1
)
if not exist "dist" (
echo [ERROR] dist folder not found!
echo Please run 'npm run build' first
pause
exit /b 1
)
echo [INFO] This may take a few minutes...
echo [INFO] Copying node_modules to dist folder...
echo.
REM Remove existing node_modules in dist if present
if exist "dist\node_modules" (
echo [INFO] Removing existing dist\node_modules...
rmdir /s /q "dist\node_modules"
)
REM Copy node_modules
xcopy /E /I /Y /Q "node_modules" "dist\node_modules" >nul
if %errorLevel% equ 0 (
echo [OK] node_modules copied successfully!
) else (
echo [ERROR] Failed to copy node_modules
pause
exit /b 1
)
echo.
echo ========================================
echo COPY COMPLETE!
echo ========================================
echo.
echo node_modules has been copied to dist folder.
echo Your app is now ready for IIS deployment.
echo.
pause