mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
This commit moves all files previously under the 'app' bundle in the Django pipeline to being compiled by webpack under the 'app' entry point. In the process, it moves assets under the app entry to a file called app.js that consumes all relevant css and js files. This commit also edits the webpack config to be able to expose certain variables for third party libraries that are currently required by some modules. This is bad coding form and should be refactored to requiring whatever dependencies a module may have; we're just deferring that to the future to simplify the series of transitions we need to do here. The variable exposure is done using expose-loader in webpack. The app/index.html template is edited to override the newly introduced 'commonjs' block in the base template. This is done as a temporary measure so as not to disrupt other pages on the app during the transition. It also fixes the value of the 'this' context that was being inferred as window by third party libraries. This is done using imports-loader in the webpack config. This is also messy and probably isn't how we want things to work long term.
49 lines
1.5 KiB
HTML
49 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang='{{LANGUAGE_CODE}}'>
|
|
|
|
{# Base template for the whole site. #}
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
{% block title %}
|
|
{% if user_profile and user_profile.realm.name %}
|
|
<title>{{user_profile.realm.name}} - Zulip</title>
|
|
{% else %}
|
|
<title>Zulip</title>
|
|
{% endif %}
|
|
{% endblock %}
|
|
<link href="/static/favicon.ico?v=2" rel="shortcut icon">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
{% if not user_profile %}
|
|
{% include 'zerver/meta_tags.html' %}
|
|
{% endif %}
|
|
|
|
{% block page_params %}
|
|
{# blueslip needs page_params.debug_mode. Set it to false by default. #}
|
|
<script type="text/javascript">
|
|
var page_params = {debug_mode: false};
|
|
</script>
|
|
{% endblock %}
|
|
<!-- This is a temporary block to enable webpack transition
|
|
This allows pages requiring common files via webpack to override
|
|
this block -->
|
|
{% block commonjs %}
|
|
{{ render_bundle('common', attrs='nonce="%s"' % (csp_nonce)) }}
|
|
{% endblock %}
|
|
{% block customhead %}
|
|
{% endblock %}
|
|
|
|
{# this is required because we want to put a custom head in
|
|
`zerver/portico.html` that isn't overwritten like the
|
|
`customhead` #}
|
|
{% block porticocustomhead %}
|
|
{% endblock %}
|
|
</head>
|
|
|
|
<body>
|
|
{% block content %}
|
|
{% endblock %}
|
|
</body>
|
|
|
|
</html>
|