From cb3949d974f30501281fd2546ef23c81ac0282b3 Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Fri, 19 Mar 2021 22:40:38 +0200 Subject: bundler --- build.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 build.ps1 (limited to 'build.ps1') diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..4506966 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,26 @@ +if (-Not Test-Path node_modules) + npm install + +# Clear the old build +Remove-Item -LiteralPath "temp" -Force -Recurse | out-null +Remove-Item -LiteralPath "build" -Force -Recurse | out-null + +echo "build.ps1: Running the Microsoft(R) TypeScript(TM) Compiler. This will take a while!" + +# Call the typescript compiler, this will output a bunch of js files in the 'temp' folder +npx tsc +if (-Not $?) { + echo "build.ps1: The Microsoft(R) TypeScript(TM) Compiler failed :(" + exit 1 +} + +echo "build.ps1: Running the bundler" + +mkdir build | out-null +npx esbuild --bundle temp/main.js --outfile=build/bundle.js +if (-Not $?) { + echo "build.ps1: The bundler failed. unlucky" + exit 1 +} + +echo "build.ps1: Build successful!" \ No newline at end of file -- cgit v1.2.3