From c92ebf30f2a1c89334ddd8b239f603b01a457b6e Mon Sep 17 00:00:00 2001 From: Tom Gallacher Date: Mon, 24 Oct 2016 14:14:11 +0100 Subject: [PATCH] make: refactor make files --- backend/Makefile | 6 ++---- cloudapi-graphql/Makefile | 6 ++---- frontend/Makefile | 6 ++---- tools/node-install.mk | 7 +++++++ ui/Makefile | 6 ++---- 5 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 tools/node-install.mk diff --git a/backend/Makefile b/backend/Makefile index ff2dc73e..f525884d 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,7 +1,5 @@ +include ../tools/node-install.mk + .PHONY: test test: ./node_modules/.bin/ava - -.PHONY: install -install: - yarn diff --git a/cloudapi-graphql/Makefile b/cloudapi-graphql/Makefile index ff2dc73e..f525884d 100644 --- a/cloudapi-graphql/Makefile +++ b/cloudapi-graphql/Makefile @@ -1,7 +1,5 @@ +include ../tools/node-install.mk + .PHONY: test test: ./node_modules/.bin/ava - -.PHONY: install -install: - yarn diff --git a/frontend/Makefile b/frontend/Makefile index 731b9a6d..f2765010 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,11 +1,9 @@ +include ../tools/node-install.mk + .PHONY: test test: npm run test -.PHONY: install -install: - yarn - .PHONY: compile compile: install NODE_ENV=production ./node_modules/.bin/webpack --config webpack/index.js diff --git a/tools/node-install.mk b/tools/node-install.mk new file mode 100644 index 00000000..44890c1d --- /dev/null +++ b/tools/node-install.mk @@ -0,0 +1,7 @@ +.PHONY: install +install: + yarn install + +.PHONY: install-production +install-production: + yarn install --production --pure-lockfile diff --git a/ui/Makefile b/ui/Makefile index c707661b..c2d49283 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -1,7 +1,5 @@ +include ../tools/node-install.mk + .PHONY: test test: yarn run test - -.PHONY: install -install: - yarn