Here’s my Make target for a full rebuild:
build:
rm -rf .daml
rm -rf daml2js
rm -rf ui/build
daml build
daml codegen js -o daml2js .daml/dist/*.dar
cd ui && yarn install --force --frozen-lockfile
cd ui && yarn build
Note that you shouldn’t have to delete these directories before building, but I tend to stay on the safe side and since none of the tools involved support incremental builds anyway it doesn’t matter much.