-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (27 loc) · 1011 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
NPM_PACKAGE := $(shell node -e 'process.stdout.write(require("./package.json").name)')
NPM_VERSION := $(shell node -e 'process.stdout.write(require("./package.json").version)')
TMP_PATH := /tmp/${NPM_PACKAGE}-$(shell date +%s)
REMOTE_NAME ?= origin
REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)
CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut -b -6) master)
GITHUB_PROJ := https://github.com/commenthol/${NPM_PACKAGE}
all: test browserify
lint:
npm run lint
test:
npm test
coverage:
npm run coverage
browserify:
rm -rf ./dist
mkdir dist
# Browserify
( printf "/*! ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} @license MIT */" ; \
./node_modules/.bin/browserify ./ -s markdownitAdmon \
) > dist/markdown-it-admon.js
# Minify
./node_modules/.bin/terser dist/markdown-it-admon.js -c -m \
--preamble "/*! ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} @license MIT */" \
> dist/markdown-it-admon.min.js
.PHONY: lint test coverage
.SILENT: lint test