#!/bin/sh # Rebuild the committed example previews from their content.json. # The previews load ES modules, so serve them over http (any static server); file:// blocks module scripts. # Also redraws nothing: run reference/make-example-assets.mjs first if the artwork changes. set -eu here=$(cd "$(dirname "$0")/.." && pwd) for name in lantern-street-shelf ladeira-azul-map; do tmp=$(mktemp -d) node "$here/reference/build.mjs" "$here/examples/$name/content.json" "$tmp" >/dev/null rm -rf "$here/examples/$name/preview" cp -R "$tmp/public" "$here/examples/$name/preview" rm -rf "$tmp" done