From 497b28f39274a3a4eb8cd94a79a84f6204476d23 Mon Sep 17 00:00:00 2001 From: rexim Date: Wed, 22 Nov 2023 09:23:39 +0700 Subject: [PATCH] [README] document the Building section --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2631e05..595d121 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,39 @@ $ iexplore.exe http://localhost:6969/ ## Building -TBD +The whole build is organized so you can just serve the repo via an HTTP server and it just works. This is done to simplify deployment to [GitHub pages](https://pages.github.com/). We just tell GitHub to service this repo as is. The build artifacts are also commited to the repo. So if you want to simply get the website working you don't even have to build anything. Just serve the repo. + +This build consist of two parts: `main` and `serviceworker`. This separation is important because these two parts are built with different TypeScript flags and dependancies. We are planning to get rid of the separation in the future somehow. + +The build is done via the [./build.js](./build.js) script. It is recommended to read it to get an idea on how it works. It is also recommended to check the `"scripts"` section of [./package.json](./package.json) to get an idea on how it is called from `npm run`. + +Before doing any building make sure you installed all the necessary dependencies: + +```console +$ npm install +``` + +To build both of the parts: + +```console +$ npm run build +``` + +### Building `main` part only + +```console +$ npm run build -- main +``` + +This command takes all the files [./ts/](./ts/) and compiles them to JavaScript in [./js/](./js/). + +### Building `serviceworker` part + +```console +$ npm run build -- serviceworker +``` + +This compiles [./serviceworker.ts](./serviceworker.ts) to [./serviceworker.js](./serviceworker.js). ## Watching