From e3b28976b67f6238680827105c275e86216c0d2c Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 9 Mar 2022 14:18:02 +0100 Subject: [PATCH] maint(Build): Makefile - Resolve package version for ZIP bundle at target runtime. --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4f9c8dac2..b3d045566 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,7 @@ YARN ?= npx yarn SOURCES = $(wildcard src/*.js) $(wildcard src/pat/*.js) $(wildcard src/lib/*.js) GENERATED = src/lib/depends_parse.js -define get_package_var -$(shell node -p "require('./package.json').$(1)") -endef -PACKAGE_NAME := $(shell node -p "'$(call get_package_var,name)'.replace('@patternslib/', '')") -PACKAGE_VERSION := $(call get_package_var,version) - +PACKAGE_NAME = "patternslib" all:: bundle css @@ -62,6 +57,7 @@ bundle: stamp-yarn $(YARN) run build release-zip: clean-dist bundle + $(eval PACKAGE_VERSION := $(shell node -p "require('./package.json').version")) @echo name is $(PACKAGE_NAME) @echo version is $(PACKAGE_VERSION) mkdir -p dist/$(PACKAGE_NAME)-bundle-$(PACKAGE_VERSION)