Add Python script to minify JS in the app

This commit is contained in:
chylex 2021-08-15 20:31:36 +02:00
parent bd78051a9d
commit be3a7d6d80
No known key found for this signature in database
GPG Key ID: 4DE42C8F19A80548

15
app/minify.py Normal file
View File

@ -0,0 +1,15 @@
# Python 3
import glob
import os
uglifyjs = os.path.abspath("../lib/uglifyjs")
input_dir = os.path.abspath("./Resources/Tracker/scripts")
output_dir = os.path.abspath("./Resources/Tracker/scripts.min")
for file in glob.glob(input_dir + "/*.js"):
name = os.path.basename(file)
print("Minifying {0}...".format(name))
os.system("{0} {1} -o {2}/{3}".format(uglifyjs, file, output_dir, name))
print("Done!")