add webapp/.npminstall target to speed up rebuilds

This commit is contained in:
Jesse Hallam 2018-07-23 14:07:42 -04:00
parent bc26a8c5d5
commit 33eb1385d2
No known key found for this signature in database
GPG key ID: E7959EB6518AF966
2 changed files with 10 additions and 2 deletions

View file

@ -40,11 +40,17 @@ ifneq ($(HAS_SERVER),)
cd server && env GOOS=windows GOARCH=amd64 $(GO) build -o dist/plugin-windows-amd64.exe; cd server && env GOOS=windows GOARCH=amd64 $(GO) build -o dist/plugin-windows-amd64.exe;
endif 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 # webapp builds the webapp, if it exists
.PHONY: webapp .PHONY: webapp
webapp: webapp: webapp/.npminstall
ifneq ($(HAS_WEBAPP),) ifneq ($(HAS_WEBAPP),)
cd webapp && npm install;
cd webapp && npm run fix; cd webapp && npm run fix;
cd webapp && npm run build; cd webapp && npm run build;
endif endif
@ -100,6 +106,7 @@ endif
clean: clean:
rm -fr dist/ rm -fr dist/
rm -fr server/dist rm -fr server/dist
rm -fr webapp/.npminstall
rm -fr webapp/dist rm -fr webapp/dist
rm -fr webapp/node_modules rm -fr webapp/node_modules
rm -fr build/bin/ rm -fr build/bin/

1
webapp/.gitignore vendored
View file

@ -1 +1,2 @@
node_modules node_modules
.npminstall