Use different js bundle with base html
This commit is contained in:
parent
708b7ee669
commit
81af2d9fcc
5 changed files with 19 additions and 13 deletions
|
@ -24,7 +24,7 @@ from _init import __version__
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
JS_BUNDLE_NAME = 'bundle'
|
||||
JS_BUNDLE_NAME = 'main'
|
||||
|
||||
|
||||
def common_login(user_uuid, permanent_session=True):
|
||||
|
@ -73,9 +73,9 @@ def _list_files(path, extension, contains=""):
|
|||
return [join_path(dp, f) for dp, _, files in os.walk(filepath) for f in files if matches(f)]
|
||||
|
||||
|
||||
def render_page_template(name, route_data=None, **kwargs):
|
||||
def render_page_template(name, route_data=None, js_bundle_name=JS_BUNDLE_NAME, **kwargs):
|
||||
""" Renders the page template with the given name as the response and returns its contents. """
|
||||
main_scripts = _list_files('build', 'js', JS_BUNDLE_NAME)
|
||||
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:
|
||||
|
|
|
@ -36,7 +36,7 @@ STATUS_TAGS = app.config['STATUS_TAGS']
|
|||
@setup_web.route('/', methods=['GET'], defaults={'path': ''})
|
||||
@no_cache
|
||||
def index(path, **kwargs):
|
||||
return render_page_template_with_routedata('config_index.html', **kwargs)
|
||||
return render_page_template_with_routedata('config_index.html', js_bundle_name='configapp', **kwargs)
|
||||
|
||||
@setup_web.errorhandler(404)
|
||||
@setup_web.route('/404', methods=['GET'])
|
||||
|
|
Reference in a new issue