-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce extension size by using Google Closure Compiler
It's not much, but it's not nothing either. Also dropped README.md from zip-file
- Loading branch information
1 parent
3dfff69
commit aa2a2bc
Showing
6 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
*.zip | ||
*.zip | ||
|
||
*.min.js | ||
|
||
closure-compiler.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
# Remove the old version of the closure compiler | ||
rm -f ./closure-compiler.jar | ||
|
||
# Fetch the latest version of the closure compiler | ||
latest_version=$(curl -s https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/ | grep -oP '(?<=href=")[^"]*(?=/)' | sort -V | tail -n 1) | ||
# Download and rename the closure compiler | ||
wget https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/$latest_version/closure-compiler-$latest_version.jar -O ./closure-compiler.jar | ||
|
||
# Verify the checksum of closure compiler with the checksum file | ||
expected_sha512=$(curl -s https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/$latest_version/closure-compiler-$latest_version.jar.sha512) | ||
computed_sha512=$(sha512sum ./closure-compiler.jar | cut -d ' ' -f 1) | ||
|
||
if [ "$computed_sha512" != "$expected_sha512" ]; then | ||
echo "Checksum verification failed!" | ||
exit 1 | ||
else | ||
echo "Checksum verification passed!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/sh | ||
# This script packs up necessary files into a .zip for publishing | ||
|
||
zip AmznShipWarn.zip amznshipwarn.js LICENSE README.md manifest.json | ||
# This script minifies and then packs up necessary files into a .zip for publishing | ||
java -jar ./closure-compiler.jar -O ADVANCED --js amznshipwarn.js --js_output_file amznshipwarn.min.js --language_out=ECMASCRIPT_2019 | ||
|
||
zip AmznShipWarn.zip amznshipwarn.min.js LICENSE manifest.json |