Przeglądaj źródła

ci: only reinstall frontend dependencies when they change (#1196)

James Read 21 godzin temu
rodzic
commit
db42ef77ec
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      frontend/Makefile

+ 7 - 1
frontend/Makefile

@@ -14,8 +14,14 @@ unittests: deps
 clean:
 	$(call delete-files,dist)
 
-deps:
+# Only run npm ci again when package.json or the lockfile is newer than the
+# last clean install, or when npm has changed node_modules since (for example
+# npm install), which rewrites node_modules/.package-lock.json.
+deps: node_modules/.npm-ci-stamp
+
+node_modules/.npm-ci-stamp: package.json package-lock.json $(wildcard node_modules/.package-lock.json)
 	npm ci
+	touch $@
 
 build:
 	npm run build