Revision 72174beff4f418fe9fbf35bbc18fc489a6f8d78e authored by Aaron Meyer on 08 September 2023, 18:10:36 UTC, committed by GitHub on 08 September 2023, 18:10:36 UTC
Also provide H back from make_svd_non_negative()
minify.py
from rcssmin import cssmin
#from slimit import minify
from jsmin import jsmin
from pathlib import Path
asset_path = Path('./themes/tensorly/static')
for path in asset_path.glob('*.js'):
# Ignore already minified files
if '.min.' in str(path):
continue
target_path = path.with_suffix('.min.js')
with open(path.as_posix(), 'r') as f:
text = f.read()
minified = jsmin(text, mangle=True, mangle_toplevel=True)
with open(target_path.as_posix(), 'w') as f:
f.write(minified)
for path in asset_path.glob('*.css'):
# Ignore already minified files
if '.min.' in str(path):
continue
target_path = path.with_suffix('.min.css')
with open(path.as_posix(), 'r') as f:
text = f.read()
minified = cssmin(text)
with open(target_path.as_posix(), 'w') as f:
f.write(minified)
Computing file changes ...