-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmake.sh
More file actions
23 lines (14 loc) · 728 Bytes
/
make.sh
File metadata and controls
23 lines (14 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
23
#!/bin/zsh
rm ./dist/*
cp "./src/caldom.js" "./dist/caldom.js"
sed "s/.*export default/export default/" "./dist/caldom.js" >> "./dist/caldom.mjs.js"
npx uglifyjs "./dist/caldom.js" --mangle --mangle-props "keep_quoted" --toplevel --compress --source-map --output "./dist/caldom.min.js"
npx uglifyjs "./dist/caldom.mjs.js" --mangle --mangle-props "keep_quoted" --toplevel --compress --source-map --output "./dist/caldom.min.mjs.js"
echo "Uglified Size:"
wc -c "./dist/caldom.min.js"
echo "GZiped Size:"
gzip < "./dist/caldom.min.js" > "./dist/caldom.min.js.gz"
wc -c "./dist/caldom.min.js.gz"
rm "./dist/caldom.min.js.gz"
# npm test
# uglifyjs "./dist/caldom.min.js" --beautify --output "./dist/caldom.min.beautiful.js"