Files
Web-NibblePoker/scripts/compile-js-external.cmd
Herwin c8bf68fa2d Moved build scripts into "scripts/", Updated readme
Update .gitignore, compile-clean.cmd, and 38 more files...
2024-04-18 18:00:28 +02:00

45 lines
1.3 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
:: Going into the script's directory
cd /D "%~dp0"
:js-external
echo.
echo Handling external libraries
echo ---------------------------
:js-external-decimaljs-minify
echo Minifying Decimal.JS
pushd %CD%
cd %~dp0\..\resources\DecimalJs\10.4.3\
echo ^> resources\DecimalJs\10.4.3\decimal.mjs
call "%~dp0node_modules\.bin\terser" decimal.mjs -c -m --toplevel -o decimal.min.mjs
cd %~dp0\..\resources\DecimalJsLight\2.5.1\
echo ^> resources\DecimalJsLight\2.5.1\decimal.mjs
call "%~dp0node_modules\.bin\terser" decimal.mjs -c -m --toplevel -o decimal.min.mjs
popd
:js-external-highlightjs
echo Handling HighlightJS
pushd %CD%
cd %~dp0\..\resources\HighlightJS\
echo ^> Clearing old files
del /Q /S /F highlight.js 2> nul 1> nul
del /Q /S /F highlight.min.js 2> nul 1> nul
echo ^> Installing dependencies
call npm install > nul
echo ^> Building for browsers
node tools/build.js -t browser sql php c cpp vbnet java yaml css scss bash ini python shell dockerfile cmake purebasic csharp 1> nul
echo ^> Moving final files
robocopy %CD%\build %CD% highlight.js highlight.min.js 1> nul
echo ^> Minifying used CSS files
call "%~dp0node_modules\.bin\sass" src/styles/atom-one-dark.css:src/styles/atom-one-dark.min.css -q --style compressed
popd
:js-external-end
:end