-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (17 loc) · 728 Bytes
/
Makefile
File metadata and controls
22 lines (17 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
BUILD_DIR = build
RELEASE_DIR = release
RESOURCES = ${BUILD_DIR}/header.js\
dev/jquery.bind-first.js\
LIB_VER = $(shell node -e "console.log(JSON.parse(require('fs').readFileSync('bind-first.jquery.json').toString()).version);")
DATE = $(shell date)
COMBINED = ${RELEASE_DIR}/jquery.bind-first-${LIB_VER}.js
MINIFIED = ${RELEASE_DIR}/jquery.bind-first-${LIB_VER}.min.js
combine: $(RESOURCES)
rm -rf ${RELEASE_DIR}
mkdir ${RELEASE_DIR}
cat $(RESOURCES) | \
sed 's/@DATE/'"${DATE}"'/' | \
sed 's/@VERSION/${LIB_VER}/' > $(COMBINED)
# sed -e's/jquery\.bind-first-.*\.min+/jquery.bind-first-${LIB_VER}\.min/' examples/index.html
min: combine
uglifyjs2 $(COMBINED) --compress --mangle --comments --output $(MINIFIED)