-
Notifications
You must be signed in to change notification settings - Fork 547
/
build.sh
55 lines (47 loc) · 1.28 KB
/
build.sh
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
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# Get the current version
version=`node -e "console.log(require('./package.json').version)"`
# Year
year=$(date +'%Y')
# Set current working directory to src/
cd src/
# Create banner
banner="/*! hellojs v${version} - (c) 2012-${year} Andrew Dodson - MIT https://adodson.com/hello.js/LICENSE */";
echo "${banner}" > ../dist/hello.js
echo "${banner}" > ../dist/hello.min.js
echo "${banner}" > ../dist/hello.all.js
echo "${banner}" > ../dist/hello.all.min.js
# Merge all src files into dist/hello.js
cat hello.polyfill.js \
hello.js \
hello.chromeapp.js \
hello.phonegap.js \
hello.amd.js \
hello.commonjs.js \
>> ../dist/hello.js
# Merge all src files and modules into dist/hello.all.js
cat hello.polyfill.js \
hello.js \
hello.chromeapp.js \
hello.phonegap.js \
modules/dropbox.js \
modules/facebook.js \
modules/flickr.js \
modules/foursquare.js \
modules/github.js \
modules/google.js \
modules/instagram.js \
modules/joinme.js \
modules/linkedin.js \
modules/soundcloud.js \
modules/spotify.js \
modules/twitter.js \
modules/vk.js \
modules/windows.js \
modules/yahoo.js \
hello.amd.js \
hello.commonjs.js \
>> ../dist/hello.all.js
# Uglify
uglifyjs ../dist/hello.js >> ../dist/hello.min.js
uglifyjs ../dist/hello.all.js >> ../dist/hello.all.min.js