Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions xmodule/util/builtin_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
from pathlib import Path

import webpack_loader
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

Expand Down Expand Up @@ -43,11 +44,6 @@ def add_webpack_js_to_fragment(fragment, bundle_name):
"""
Add all JS webpack chunks to the supplied fragment.
"""
# Importing webpack_loader.utils at the top of the module causes an exception:
# OSError: Error reading webpack-stats.json.
# Are you sure webpack has generated the file and the path is correct?
# We are not quite sure why.
from webpack_loader.utils import get_files
for chunk in get_files(bundle_name, None, 'DEFAULT'):
for chunk in webpack_loader.utils.get_files(bundle_name, None, 'DEFAULT'):
if chunk['name'].endswith(('.js', '.js.gz')):
fragment.add_javascript_url(chunk['url'])
Loading