chore: do not try to create source maps for now

It's more complex than what we thought.
This commit is contained in:
Yohan Boniface 2024-01-19 17:43:18 +01:00
parent 541fbd4e56
commit 283ad44515

View file

@ -61,17 +61,11 @@ class UmapManifestStaticFilesStorage(ManifestStaticFilesStorage):
if processed_path.endswith(".js"): if processed_path.endswith(".js"):
path = Path(settings.STATIC_ROOT) / processed_path path = Path(settings.STATIC_ROOT) / processed_path
initial = path.read_text() initial = path.read_text()
path_map = path.with_suffix(f"{path.suffix}.map")
minified = jsmin(initial) minified = jsmin(initial)
minified += f"\n//# sourceMappingURL={path_map.name}"
path.write_text(minified) path.write_text(minified)
path_map.write_text(initial)
if processed_path.endswith(".css"): if processed_path.endswith(".css"):
path = Path(settings.STATIC_ROOT) / processed_path path = Path(settings.STATIC_ROOT) / processed_path
initial = path.read_text() initial = path.read_text()
path_map = path.with_suffix(f"{path.suffix}.map")
minified = cssmin(initial) minified = cssmin(initial)
minified += f"\n//# sourceMappingURL={path_map.name}"
path.write_text(minified) path.write_text(minified)
path_map.write_text(initial)
yield original_path, processed_path, True yield original_path, processed_path, True