aboutsummaryrefslogtreecommitdiffstats
path: root/build.ps1
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-03-19 22:40:38 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-03-19 22:40:38 +0200
commitcb3949d974f30501281fd2546ef23c81ac0282b3 (patch)
treeb463e63c16c9288af42d34cf86a0fd6ffeeeb5a5 /build.ps1
parentdd6cf660b033251c5ab08fa0c3e32a44022a7039 (diff)
downloadfileup-cb3949d974f30501281fd2546ef23c81ac0282b3.tar.gz
bundler
Diffstat (limited to 'build.ps1')
-rw-r--r--build.ps126
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