<script type="module" src="-------------"></script>
Hey, so, I need to use a script, but I need it's type to be a "module" instead of a regular script, how can I achieve this? Bare in mind I'm on mobile
I imported the script and I'm using it on the screen, using F12 I can see it is consuming the screen, just doesn't have the type I need.
Hi Fábio,
What is a script of type module?
Why does the type need to be "module", actually to include a javascript file type attribute is not at all required for many years.
Regards,
Daniel
I stumbled upon this and it seems it is required in some cases where the script should be treated as a javascript module: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
Pedro did you manage to find how to solve this?
Did anyone ever get an answer?
Hey! I just passed by this post.
Assuming you have a .mjs or a .js file, import it on the resources.
Deploy action: Deploy to Target Directory
Capture the runtime directory - you will need it.
And then, in your script:
Cheers!