forked from katspaugh/wavesurfer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (26 loc) · 848 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
# npm install -g uglify-js
PREAMBLE='/* wavesurfer.js v'`node -e 'console.log(require("./package.json").version)'`' */'
BUILD_DIR=build
MIN=$(BUILD_DIR)/wavesurfer.min.js
AMD=$(BUILD_DIR)/wavesurfer.amd.js
CJS=$(BUILD_DIR)/wavesurfer.cjs.js
SOURCE_MAP=wavesurfer-js-map.json
SOURCE_MAP_ROOT=/
SOURCES=src/wavesurfer.js\
src/webaudio.js\
src/audioelement.js\
src/drawer.js\
src/drawer.*.js
$(MIN): $(SOURCES)
uglifyjs --lint -cm -o $@ $^ \
--source-map=$(BUILD_DIR)/$(SOURCE_MAP) --source-map-root=$(SOURCE_MAP_ROOT) \
--source-map-url=$(SOURCE_MAP) \
--preamble=$(PREAMBLE)
amd: $(SOURCES)
echo $(PREAMBLE)" define(function () {" > $(AMD)
uglifyjs $^ -cm >> $(AMD)
echo "\n;return WaveSurfer; });" >> $(AMD)
cjs: $(SOURCES)
cat $^ >> $(CJS)
echo "\nmodule.exports = WaveSurfer;" >> $(CJS)
.PHONY: amd cjs