whitelisted moment.js locales to reduce bundle size

This commit is contained in:
Alec Merdler 2017-08-02 11:26:36 -04:00
parent 82a08a942e
commit 6dae6c4f82
6 changed files with 13 additions and 19 deletions

View file

@ -24,6 +24,9 @@ from _init import __version__
logger = logging.getLogger(__name__)
JS_BUNDLE_NAME = 'bundle'
def common_login(user_uuid, permanent_session=True):
""" Performs login of the given user, with optional non-permanence on the session. """
user = model.get_user(user_uuid)
@ -71,10 +74,7 @@ def _list_files(path, extension, contains=""):
def render_page_template(name, route_data=None, **kwargs):
""" Renders the page template with the given name as the response and returns its contents. """
library_styles = []
main_styles = []
library_scripts = []
main_scripts = _list_files('build', 'js', "bundle")
main_scripts = _list_files('build', 'js', JS_BUNDLE_NAME)
use_cdn = app.config.get('USE_CDN', True)
if request.args.get('use_cdn') is not None:
@ -118,10 +118,7 @@ def render_page_template(name, route_data=None, **kwargs):
route_data=route_data,
external_styles=external_styles,
external_scripts=external_scripts,
main_styles=main_styles,
library_styles=library_styles,
main_scripts=main_scripts,
library_scripts=library_scripts,
feature_set=features.get_features(),
config_set=frontend_visible_config(app.config),
oauth_set=get_oauth_config(),