aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbarenblat@gmail.com>2021-12-22 15:55:51 -0500
committerGravatar Benjamin Barenblat <bbarenblat@gmail.com>2021-12-22 15:55:51 -0500
commit5244963a46843e4fa2888c4ed981b1aa47dd563d (patch)
treed6021c8453ce1381d8f7d30796da2266978ae411
parent2c3896d683754e11d925676cb4eb4db7d1e46321 (diff)
Minify JavaScript and manifest.json in uploads
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ce0ef3e..a7c32c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
# Copyright 2019 Google LLC
+# Copyright 2021 Benjamin Barenblat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -14,11 +15,11 @@
NAME = disable_keyboard_shortcuts
-FILES = background.js manifest.json icon128.png icon48.png
-
-$(NAME).zip: $(FILES)
+$(NAME).zip: background.js manifest.json icon128.png icon48.png
mkdir $(NAME)
- cp -al $(FILES) $(NAME)
+ uglifyjs background.js -m -o $(NAME)/background.js
+ jq -Sc . manifest.json >$(NAME)/manifest.json
+ cp -al icon128.png icon48.png $(NAME)
zip -9r $(NAME) $(NAME)
$(RM) -r $(NAME)