From 33eb1385d235bb8b674c02a1c1accc8ed89c0e9d Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Mon, 23 Jul 2018 14:07:42 -0400 Subject: [PATCH] add webapp/.npminstall target to speed up rebuilds --- Makefile | 11 +++++++++-- webapp/.gitignore | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5f9b120..3551830 100644 --- a/Makefile +++ b/Makefile @@ -40,11 +40,17 @@ ifneq ($(HAS_SERVER),) cd server && env GOOS=windows GOARCH=amd64 $(GO) build -o dist/plugin-windows-amd64.exe; endif +# webapp/.npminstall ensures NPM dependencies are installed without having to run this all the time +webapp/.npminstall: +ifneq ($(HAS_WEBAPP),) + cd webapp && npm install + touch $@ +endif + # webapp builds the webapp, if it exists .PHONY: webapp -webapp: +webapp: webapp/.npminstall ifneq ($(HAS_WEBAPP),) - cd webapp && npm install; cd webapp && npm run fix; cd webapp && npm run build; endif @@ -100,6 +106,7 @@ endif clean: rm -fr dist/ rm -fr server/dist + rm -fr webapp/.npminstall rm -fr webapp/dist rm -fr webapp/node_modules rm -fr build/bin/ diff --git a/webapp/.gitignore b/webapp/.gitignore index 3c3629e..3c36a8f 100644 --- a/webapp/.gitignore +++ b/webapp/.gitignore @@ -1 +1,2 @@ node_modules +.npminstall