From 379fd891daa969a969f2f3e4738d81665f76ad7a Mon Sep 17 00:00:00 2001 From: Maphikza Date: Thu, 15 May 2025 19:50:18 +0200 Subject: [PATCH] Enhance start.bat with improved Node.js v23 compatibility and build process - Add memory allocation increase (--max-old-space-size=4096) - Add theme building step using lessc before starting the app - Change from yarn start to yarn run craco start - Add error handling with proper exit codes - Improve script structure with goto statements for better flow control --- start.bat | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/start.bat b/start.bat index 08ccc57e..c6adb7b6 100644 --- a/start.bat +++ b/start.bat @@ -1,6 +1,20 @@ @echo off REM This script sets the necessary environment variable and starts the React app -echo Setting OpenSSL legacy provider and starting the app... -set NODE_OPTIONS=--openssl-legacy-provider -yarn start \ No newline at end of file +echo Setting OpenSSL legacy provider and increasing memory allocation... +set "NODE_OPTIONS=--openssl-legacy-provider --max-old-space-size=4096" + +REM Run lessc directly using local node_modules +call node_modules\.bin\lessc --js --clean-css="--s1 --advanced" src/styles/themes/main.less public/themes/main.css +if errorlevel 1 goto error + +echo Theme built successfully, starting the app... +call yarn run craco start +if errorlevel 1 goto error +goto end + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% + +:end \ No newline at end of file