Skip to content
Snippets Groups Projects
Commit fb19d328 authored by Andy Armstrong's avatar Andy Armstrong
Browse files

Don't package or optimize assets on devstack

parent 42181aea
No related branches found
No related tags found
No related merge requests found
......@@ -277,13 +277,6 @@ XQUEUE_INTERFACE = {
simplefilter('ignore')
################################# Middleware ###################################
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
......@@ -460,9 +453,23 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
##### EMBARGO #####
EMBARGO_SITE_REDIRECT_URL = None
############################### Pipeline #######################################
############################### PIPELINE #######################################
# Process static files using RequireJS Optimizer
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
]
# Don't use compression by default
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None
from openedx.core.lib.rooted_paths import rooted_glob
PIPELINE_CSS = {
......@@ -550,7 +557,9 @@ PIPELINE_JS_COMPRESSOR = None
STATICFILES_IGNORE_PATTERNS = (
"*.py",
"*.pyc",
# it would be nice if we could do, for example, "**/*.scss",
"*.html",
# It would be nice if we could do, for example, "**/*.scss",
# but these strings get passed down to the `fnmatch` module,
# which doesn't support that. :(
# http://docs.python.org/2/library/fnmatch.html
......@@ -563,6 +572,10 @@ STATICFILES_IGNORE_PATTERNS = (
"coffee/*/*/*.coffee",
"coffee/*/*/*/*.coffee",
# Ignore tests
"spec",
"spec_helpers",
# Symlinks used by js-test-tool
"xmodule_js",
"common_static",
......
......@@ -33,8 +33,14 @@ FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE
########################### PIPELINE #################################
# Skip RequireJS optimizer in development
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
# Skip packaging and optimization in development
STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
############################# ADVANCED COMPONENTS #############################
......
......@@ -20,7 +20,17 @@ DATABASES = {
},
}
######################### Static file overrides ####################################
######################### PIPELINE ####################################
# Use RequireJS optimized storage
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# Revert to the default set of finders as we don't want to dynamically pick up files from the pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
# Redirect to the test_root folder within the repo
TEST_ROOT = REPO_ROOT / "test_root"
......@@ -33,4 +43,3 @@ 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
......@@ -1115,13 +1115,6 @@ CREDIT_NOTIFICATION_CACHE_TIMEOUT = 5 * 60 * 60
simplefilter('ignore')
################################# Middleware ###################################
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
......@@ -1209,10 +1202,32 @@ MIDDLEWARE_CLASSES = (
# Clickjacking protection can be enabled by setting this to 'DENY'
X_FRAME_OPTIONS = 'ALLOW'
############################### Pipeline #######################################
############################### PIPELINE #######################################
# Process static files using RequireJS Optimizer
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
]
# Don't use compression by default
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
PIPELINE_COMPILE_INPLACE = True
# Don't wrap JavaScript as there is code that depends upon updating the global namespace
PIPELINE_DISABLE_WRAPPER = True
# Specify the UglifyJS binary to use
PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs'
from openedx.core.lib.rooted_paths import rooted_glob
courseware_js = (
......@@ -1605,8 +1620,6 @@ PIPELINE_JS = {
}
}
PIPELINE_DISABLE_WRAPPER = True
# Compile all coffee files in course data directories if they are out of date.
# TODO: Remove this once we move data into Mongo. This is only temporary while
# course data directories are still in use.
......@@ -1627,25 +1640,32 @@ if os.path.isdir(DATA_DIR):
os.system("coffee -c %s" % (js_dir / filename))
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = "pipeline.compressors.uglifyjs.UglifyJSCompressor"
STATICFILES_IGNORE_PATTERNS = (
"sass/*",
"*.py",
"*.pyc",
"*.html",
# It would be nice if we could do, for example, "**/*.scss",
# but these strings get passed down to the `fnmatch` module,
# which doesn't support that. :(
# http://docs.python.org/2/library/fnmatch.html
"sass/*.scss",
"sass/*/*.scss",
"sass/*/*/*.scss",
"sass/*/*/*/*.scss",
"coffee/*.coffee",
"coffee/*/*.coffee",
"coffee/*/*/*.coffee",
"coffee/*/*/*/*.coffee",
# Ignore tests
"spec",
"spec_helpers",
# Symlinks used by js-test-tool
"xmodule_js",
)
PIPELINE_UGLIFYJS_BINARY = 'node_modules/.bin/uglifyjs'
# Setting that will only affect the edX version of django-pipeline until our changes are merged upstream
PIPELINE_COMPILE_INPLACE = True
################################# DJANGO-REQUIRE ###############################
......
......@@ -85,8 +85,17 @@ def should_show_debug_toolbar(_):
########################### PIPELINE #################################
# # Skip RequireJS optimizer in development
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
# Skip packaging and optimization in development
STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
# Disable JavaScript compression in development
PIPELINE_JS_COMPRESSOR = None
# Whether to run django-require in debug mode.
REQUIRE_DEBUG = DEBUG
......
......@@ -32,7 +32,16 @@ XQUEUE_INTERFACE = {
}
######################### Static file overrides ####################################
######################### PIPELINE ####################################
# Use RequireJS optimized storage
STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
# Revert to the default set of finders as we don't want to dynamically pick up files from the pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
]
# Redirect to the test_root folder within the repo
TEST_ROOT = REPO_ROOT / "test_root"
......@@ -45,4 +54,3 @@ STATIC_ROOT = (TEST_ROOT / "staticfiles" / "lms").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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment