diff options
Diffstat (limited to 'build.ps1')
-rw-r--r-- | build.ps1 | 26 |
1 files changed, 26 insertions, 0 deletions
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 |