{% set rendered_files = [] %} {% set rendered_chunks = [] %} {% macro render_chunk(chunk_name, level=0) %} {% if chunk_name not in rendered_chunks %} {% set _ = rendered_chunks.append(chunk_name) %} {% set chunk = manifest[chunk_name] %} {% if chunk.css %} {% for css_file in chunk.css %} {% if css_file not in rendered_files %} {% set _ = rendered_files.append(css_file) %} {% endif %} {% endfor %} {% endif %} {% if chunk.imports %} {% for import in chunk.imports %} {{ render_chunk(import, level + 1) }} {% endfor %} {% endif %} {% if level == 0 %} {% if chunk.file.endswith('.js') and chunk.file not in rendered_files %} {% set _ = rendered_files.append(chunk.file) %} {% elif chunk.file.endswith('.css') and chunk.file not in rendered_files %} {% set _ = rendered_files.append(chunk.file) %} {% endif %} {% endif %} {% if chunk.file.endswith('.js') and chunk.file not in rendered_files %} {% set _ = rendered_files.append(chunk.file) %} {% endif %} {% endif %} {% endmacro %} Phoenix
{% if is_development %} {% else %} {{ render_chunk('index.tsx') }} {% endif %}