From d05931abbc69e101ff74155c555cd910cba45971 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Wed, 7 Jun 2023 11:07:01 -0400 Subject: [PATCH] Revert "build: stop suffixing XModule SCSS with hashes (#32288)" This reverts commit cef8c062a22112c28ddaec2c2186ea0bd48de00c. --- xmodule/static_content.py | 3 ++- xmodule/util/xmodule_django.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xmodule/static_content.py b/xmodule/static_content.py index a89ab1bf3b3..57eb8ce2348 100755 --- a/xmodule/static_content.py +++ b/xmodule/static_content.py @@ -150,8 +150,9 @@ def _write_styles(selector, output_root, classes, css_attribute, suffix): )) module_styles_lines.extend(f' @import "{name}";' for name in fragment_names) module_styles_lines.append('}') + file_hash = hashlib.md5("".join(fragment_names).encode('ascii')).hexdigest() - contents[f"{class_.__name__}{suffix}.scss"] = '\n'.join(module_styles_lines) + contents[f"{class_.__name__}{suffix}.{file_hash}.scss"] = '\n'.join(module_styles_lines) _write_files(output_root, contents) diff --git a/xmodule/util/xmodule_django.py b/xmodule/util/xmodule_django.py index 1d9a858ea49..248e10bf981 100644 --- a/xmodule/util/xmodule_django.py +++ b/xmodule/util/xmodule_django.py @@ -61,9 +61,9 @@ def load_assets(self): 'path': '/openedx/edx-platform/common/static/bundles/AnnotatableBlockPreview.js.map' }, { - 'name': 'AnnotatableBlockPreview.css', - 'path': 'common/static/css/xmodule/AnnotatableBlockPreview.css', - 'publicPath': '/static/css/xmodule/AnnotatableBlockPreview.css' + 'name': 'AnnotatableBlockPreview.85745121.css', + 'path': 'common/static/css/xmodule/AnnotatableBlockPreview.85745121.css', + 'publicPath': '/static/css/xmodule/AnnotatableBlockPreview.85745121.css' } ], ...