Skip to content

Commit

Permalink
Update build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfVoxel committed Oct 16, 2024
1 parent 906cca3 commit 1297a93
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
all:
node build.mjs
watch: install
NODE_ENV=development node build.mjs

install:
npm install

build: install
NODE_ENV=production node build.mjs
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Makerspace Task List
====================
# Makerspace Task List

Takes a public Trello board and shows it as a nice list, suitable for printing on A4 paper.

Expand All @@ -9,4 +8,18 @@ The page header, date and extra text to the right, is editable directly in the b

At the top one can select both which board to use, and which lists from that board to include. These settings are hidden when printing.

![Screenshot](./docs/screenshot.png)
![Screenshot](./docs/screenshot.png)

## Usage

Development mode:

```bash
make watch
```

Production build:

```bash
make build
```
20 changes: 13 additions & 7 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ const ctx = await esbuild.context({
outdir: 'dist',
});

let { host, port } = await ctx.serve({
servedir: 'dist',
onRequest: () => {
}
});
if (process.env.NODE_ENV === 'production') {
await ctx.rebuild();
console.log('Build succeeded.');
process.exit(0);
} else {
let { host, port } = await ctx.serve({
servedir: 'dist',
onRequest: () => {
}
});

console.log('Build succeeded. Serving on http://' + host + ':' + port);
console.log("Watching for changes...");
console.log('Build succeeded. Serving on http://' + host + ':' + port);
console.log("Watching for changes...");
}

0 comments on commit 1297a93

Please sign in to comment.