forked from nishanths/zoom.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 1.11 KB
/
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
37
38
39
40
41
42
43
44
.PHONY: dist clean
webpack = ./node_modules/webpack/bin/webpack.js
babel = ./node_modules/babel-cli/bin/babel.js
uglifyjs = node ./node_modules/uglifyjs/bin/uglifyjs
define PREAMBLE
/**
* Pure JavaScript implementation of zoom.js.
*
* Original preamble:
* zoom.js - It's the best way to zoom an image
* @version v0.0.2
* @link https://github.com/fat/zoom.js
* @license MIT
*
* This is a fork of the original zoom.js implementation by @fat.
* Copyrights for the original project are held by @fat. All other copyright
* for changes in the fork are held by Nishanth Shanmugham.
*
* Copyright (c) 2013 @fat
* The MIT License. Copyright © 2016 Nishanth Shanmugham.
*/
endef
export PREAMBLE
OPTS = --screw-ie8 --preamble="$$PREAMBLE"
dist: clean
mkdir dist
# make single script file
$(webpack) script/init.js dist/zoom.js
# transpile down to ES5, wrap in IIFE
$(babel) dist/zoom.js --presets=es2015-script --plugins=iife-wrap --out-file=dist/zoom.js
# dist
$(uglifyjs) dist/zoom.js $(OPTS) --beautify -o dist/zoom.js
$(uglifyjs) dist/zoom.js $(OPTS) --compress --mangle -o dist/zoom.min.js
clean:
rm -rf dist