From a6afb5b6f2b69ad6ae6391757c762db6f851019b Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 1 Jun 2020 20:06:07 -0400 Subject: [PATCH] make: Minimize reasons to rebuild with webpack Updating public/*.html doesn't require rebuilding all the javascript we ship (usually). As such, I'm updating the reasons to run build.sh to be JUST the ASSETS in assets/, everything else under public is a reason to rebuild the build/ directory, but not a reason to rebuild build/asset. Long live fast deployments. --- .gitignore | 4 +++- Makefile | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3ddb444..06bd46f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ public/asset tags /build/ /build.*/ -.public.ts + +# Timestamp files +.*.ts diff --git a/Makefile b/Makefile index 0fdd184..997374d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Rebuilding the webpack for a server-only release is a painful # few minutes on my poor old thinkpad. We can do better -JS_FILES := $(shell find assets) +ASSETS := $(shell find assets) PUBLIC_FILES := $(shell find public) LIB_FILES := $(shell find lib) @@ -19,12 +19,12 @@ test: # If no public files have changed, don't rebuild the webpack! # We make this timestamp file the dependency for build to # ensure we don't do it too often... -.public.ts: $(JS_FILES) $(PUBLIC_FILES) +.assets.ts: $(ASSETS) ./bin/build.sh - touch .public.ts + touch .assets.ts # Only rebuild if any of public/ or the Perl stuff has changed -build: .public.ts $(LIB_FILES) gloat.pl +build: .assets.ts $(PUBLIC_FILES) $(LIB_FILES) gloat.pl rm -rf build mkdir -p build cp -a gloat.pl public lib build -- libgit2 1.1.1