https://pvzm.net/ to play [Read-only GitHub mirror]
pvzm.net
modded
vs
pvz
plants-vs-zombies
plantsvszombies
javascript
online
zombie
noads
jspvz
pvzm
game
plants
plant
1#!/bin/bash
2set -e
3
4npm install -g oxlint oxfmt esbuild html-minifier-terser
5
6# stamp
7echo "$CF_PAGES_COMMIT_SHA" > game/images/Zombies/CX/v.html
8
9# lint & format
10oxlint . || true
11oxfmt --write . "**/*.{js,md,html,css,yml}"
12
13# bundle entry point
14esbuild game/js/CPlants.js \
15 --bundle --minify --sourcemap \
16 --outfile=game/js/CPlants.js --allow-overwrite
17
18# minify remaining js & css
19find . -type f \( -name "*.js" -o -name "*.css" \) \
20 -not -path "./node_modules/*" \
21 -not -name "CPlants.js" | \
22 xargs -P4 -I{} esbuild {} \
23 --minify --sourcemap \
24 --outdir=. --allow-overwrite &
25
26# minify html
27find . -type f -name "*.html" \
28 -not -path "./node_modules/*" | \
29 xargs -P4 -I{} html-minifier-terser \
30 --collapse-whitespace --remove-comments --remove-tag-whitespace \
31 --minify-css true --minify-js true -o {} {} &
32
33wait