{% macro LoadBundle(bundle) -%}
    <script type='module'>
        import('{{ ("scripts/module/" + bundle) | asset_url }}');
    </script>
    <script nomodule src="{{ 'vendor/system.js' | asset_url }}"></script>
    <script nomodule>
        System.import('{{ ("scripts/nomodule/" + bundle) | asset_url }}');
    </script>
{%- endmacro %}

{% macro LoadBundle(bundle) -%}
    <script type='module'>
        import('{{ ("scripts/module/" + bundle) | asset_url }}');
        window.hasDynamicImport = true;
    </script>
    <script nomodule src="{{ 'vendor/system.js' | asset_url }}"></script>
    <script nomodule>
        System.import('{{ ("scripts/nomodule/" + bundle) | asset_url }}');
    </script>
    <!-- nomodule fallback: modules, no dynamic import -->
    <script type="module">
        if (!window.hasDynamicImport) {
            const noms = Array.prototype.filter.call(document.getElementsByTagName('script'), x => x.hasAttribute('nomodule'));
            function nextLoad (nom, s) {
                if (!(nom = noms.shift())) return;
                s = document.createElement('script');
                if (nom.src) {
                    s.src = nom.src, s.addEventListener('load', nextLoad), s.addEventListener('error', nextLoad);
                } else {
                    s.innerHTML = nom.innerHTML;
                }
                document.head.appendChild(s);
                if (!nom.src) nextLoad();
            }
            nextLoad();
        }
    </script>
{%- endmacro %}

Add fall-back loading for browsers with module support but not dynamic import (eg, Firefox)
Add fall-back loading for browsers with module support but not dynamic import (eg, Firefox)
