peytonplayz585-shadow-4.0/desktopRuntime/minifier.py

17 lines
462 B
Python
Raw Normal View History

2024-06-07 14:07:36 -07:00
from jsmin import jsmin
import sys
if len(sys.argv) < 3:
print("Usage: python jsminify.py <sourcePath> <minifiedPath>")
sys.exit(1)
source_path = sys.argv[1]
minified_path = sys.argv[2]
with open(source_path, 'r', encoding="utf8") as js_file:
minified = jsmin(js_file.read())
with open(minified_path, 'w', encoding="utf8") as minified_file:
minified_file.write(minified)
print(f"Minification done. Output at {minified_path}")