#can i use scripts without type='module', but not inline?
12 messages · Page 1 of 1 (latest)
You can do the following
import scriptSrc from "./some-script.js?url" // Note the ?url
---
<script is:inline src={scriptSrc}></script>
This will add the script tag with your unmodified (maybe minified?) script as the src
cant use modules now)))))))))))))))))))))))))))))))))))))
Do you want to use regular modules (imported from a url) or imported from npm (just import {something} from "foo")?
both, as if it were a regular script (but if there are no solution for node modules, i can live without it)
You cannot use those imports without it being type=module
It would probably be better to add a class to your element that hides it, and then remove it in the script to show it once the script loads
But why? Everything is going into one file anyway. And works just fine if type="module" is deleted
but with type="module" old browsers (even 2017 year) have some issues
import x from y is limited to type="module" if you run it in a browser
I may have misunderstood, what is it exactly that you are trying to do and why is your current approach not working
i want to same behavior, but in build i want that scripts have type "text/javascript" or no type at all (thats what im quickfixed in screenshot above)