{% extends 'components/shell.html' %}

{# TODO: filter only admin entry #}
{% block bundler_output %}
  <% for (const css in htmlWebpackPlugin.files.css) { %>
    <% if (htmlWebpackPlugin.files.css[css].startsWith("/static/bundle/css/admin")) { %>
      <link rel="stylesheet" href="<%= htmlWebpackPlugin.files.css[css] %>">
    <% } %>
  <% } %>
  <% for (const chunk in htmlWebpackPlugin.files.chunks) { %>
    <script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>" defer></script>
  <% } %>
  <% for (const scriptPath in htmlWebpackPlugin.files.js) { %>
    <% if (htmlWebpackPlugin.files.js[scriptPath].startsWith("/static/bundle/js/admin") || htmlWebpackPlugin.files.js[scriptPath].startsWith("/static/bundle/js/runtime") || htmlWebpackPlugin.files.js[scriptPath].startsWith("/static/bundle/js/vendors")) { %>
      <script src="<%= htmlWebpackPlugin.files.js[scriptPath] %>" defer></script>
    <% } %>
  <% } %>
{% endblock bundler_output %}
