{% load friendly_loader wagtailcore_tags wagtailsettings_tags cjkcms_tags %}
{% friendly_load webpack_loader %}

    {% if settings.cjkcms.LayoutSettings.frontend_theme == 'python-webpack' %}
        {% if_has_tag javascript_pack %}
            {% javascript_pack 'app' attrs='charset="UTF-8"' %} {# you may add space-separated 'app2' etc after 'app' #}
        {% endif_has_tag %}
    {% else %}
        <script src="{% theme_js %}" 
            crossorigin="anonymous"></script>              
    {% endif %}