Makefile -- run npm build whenever any .js file changes inside client/

This commit is contained in:
Eugene Bujak 2018-10-10 17:56:48 +03:00
parent ee8759f063
commit d591ea6264
1 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,8 @@ NATIVE_GOARCH = $(shell unset GOARCH; go env GOARCH)
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(patsubst %/,%,$(dir $(mkfile_path))) mkfile_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
GOPATH := $(mkfile_dir)/build/gopath GOPATH := $(mkfile_dir)/build/gopath
STATIC := build/static/index.html JSFILES = $(shell find client -path client/node_modules -prune -o -type f -name '*.js')
STATIC = build/static/index.html
.PHONY: all build clean .PHONY: all build clean
all: build all: build
@ -15,7 +16,7 @@ client/node_modules: client/package.json client/package-lock.json
npm --prefix client install npm --prefix client install
touch client/node_modules touch client/node_modules
$(STATIC): client/node_modules $(STATIC): $(JSFILES) client/node_modules
npm --prefix client run build-prod npm --prefix client run build-prod
AdguardDNS: $(STATIC) *.go AdguardDNS: $(STATIC) *.go