JS and its ecosystem is absolute garbage

This commit is contained in:
Igor Katson 2023-11-21 03:43:32 +00:00
parent f1c1486417
commit e5d96243d4
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
20 changed files with 2796 additions and 2982 deletions

View file

@ -0,0 +1,25 @@
#!/usr/bin/env python
import os
import json
os.chdir('dist')
with open('manifest.json', 'r') as f:
manifest = json.load(f)
for replacements in manifest.values():
js_file = replacements['file']
target_file = replacements['src']
with open(target_file, 'r') as f:
target_content = f.read()
target_content = target_content.replace("/" + js_file, 'app.js')
with open(target_file, 'w') as f:
f.write(target_content)
os.rename(js_file, 'app.js')
os.rmdir('assets')
os.remove('manifest.json')