javascript module question Hi hope you can help with this and hoping it's simple. I need to write a javascript module and would like to use the js tag:
{% js %}

        //script here

{% endjs %}

This is good because it only gets embedded when needed and it gets placed at the bottom of the page and I can add craftcms variables to it. The problem I have is that the script is being outputted as
&lt;script&gt;
// script here
&lt;/script&gt;

and what I need is
&lt;script type=&quot;module&quot;&gt;
// script here
&lt;/script&gt;

Any idea how I can do that?
Thanks
I'm not sure this is possible, but another approach would be to create a new extendable block in your parent template:
// layout.twig

{% block scripts %}

{% endblock %}

// component.twig

{% extends 'layout.twig' %}

{% block scripts %}
    &lt;script type=&quot;module&quot;&gt;
        // script here
    &lt;/script&gt;
{% endblock %}