{% load static %}

{% if MINIFIED %}
<script src="{% static 'unicorn/js/unicorn.min.js' %}"></script>

<script>
  var url = "{% url 'django_unicorn:message' %}";
  Unicorn.init(url, "{{ CSRF_HEADER_NAME }}");
</script>
{% else %}
<script type="module">
  import * as Unicorn from "{% static 'unicorn/js/unicorn.js' %}";

    // Set Unicorn to the global so it can be used by components
    window.Unicorn = Unicorn;

    var url = "{% url 'django_unicorn:message' %}";
    Unicorn.init(url, "{{ CSRF_HEADER_NAME }}");
</script>
{% endif %}