Implement RequireJS Optimizer in the LMS
TNL-2487
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
"""
|
||||
Settings for Bok Choy tests that are used for running CMS and LMS.
|
||||
Settings for Bok Choy tests that are used when running Studio.
|
||||
|
||||
Bok Choy uses two different settings files:
|
||||
1. test_static_optimized is used when invoking collectstatic
|
||||
2. bok_choy is used when running CMS and LMS
|
||||
2. bok_choy is used when running the tests
|
||||
|
||||
Note: it isn't possible to have a single settings file, because Django doesn't
|
||||
support both generating static assets to a directory and also serving static
|
||||
|
||||
@@ -455,7 +455,7 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
|
||||
EMBARGO_SITE_REDIRECT_URL = None
|
||||
|
||||
############################### Pipeline #######################################
|
||||
STATICFILES_STORAGE = 'cms.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
|
||||
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
|
||||
|
||||
from openedx.core.lib.rooted_paths import rooted_glob
|
||||
|
||||
@@ -573,7 +573,7 @@ REQUIRE_BASE_URL = "./"
|
||||
# A sensible value would be 'app.build.js'. Leave blank to use the built-in default build profile.
|
||||
# Set to False to disable running the default profile (e.g. if only using it to build Standalone
|
||||
# Modules)
|
||||
REQUIRE_BUILD_PROFILE = "build.js"
|
||||
REQUIRE_BUILD_PROFILE = "cms/js/build.js"
|
||||
|
||||
# The name of the require.js script used by your project, relative to REQUIRE_BASE_URL.
|
||||
REQUIRE_JS = "js/vendor/require.js"
|
||||
@@ -592,6 +592,8 @@ REQUIRE_EXCLUDE = ("build.txt",)
|
||||
# It can also be a path to a custom class that subclasses require.environments.Environment and defines some "args" function that returns a list with the command arguments to execute.
|
||||
REQUIRE_ENVIRONMENT = "node"
|
||||
|
||||
################################# TENDER ######################################
|
||||
|
||||
# If you want to enable Tender integration (http://tenderapp.com/),
|
||||
# put in the subdomain where Tender hosts tender_widget.js. For example,
|
||||
# if you want to use the URL https://example.tenderapp.com/tender_widget.js,
|
||||
|
||||
@@ -29,6 +29,9 @@ TEST_ROOT = REPO_ROOT / "test_root" # pylint: disable=no-value-for-parameter
|
||||
# Enable debug so that static assets are served by Django
|
||||
DEBUG = True
|
||||
|
||||
# Set REQUIRE_DEBUG to false so that it behaves like production
|
||||
REQUIRE_DEBUG = False
|
||||
|
||||
# Serve static files at /static directly from the staticfiles directory under test root.
|
||||
# Note: optimized files for testing are generated with settings from test_static_optimized
|
||||
STATIC_URL = "/static/"
|
||||
|
||||
@@ -33,3 +33,4 @@ STATIC_ROOT = (TEST_ROOT / "staticfiles" / "cms").abspath()
|
||||
# 1. Uglify is by far the slowest part of the build process
|
||||
# 2. Having full source code makes debugging tests easier for developers
|
||||
os.environ['REQUIRE_BUILD_PROFILE_OPTIMIZE'] = 'none'
|
||||
PIPELINE_JS_COMPRESSOR = None
|
||||
|
||||
Reference in New Issue
Block a user