Просмотр исходного кода

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

James Read 21 часов назад
Родитель
Сommit
db42ef77ec
1 измененных файлов с 7 добавлено и 1 удалено
  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