kotlinx.html icon indicating copy to clipboard operation
kotlinx.html copied to clipboard

ScriptType of `<script>` is missing type "module"

Open johannesrave opened this issue 1 year ago • 1 comments

I couldn't find a way to express

<script type="module" src="/scripts/.js"></script>

other than

unsafe {
    raw("<script type="module" src="/scripts/live-reload.js"></script>")
}

Is that missing from ScriptType on purpose for some reason? Or has it not yet been implemented?

johannesrave avatar Aug 07 '22 21:08 johannesrave

You could either do:

script(src = "index.js") {
    attributes["type"] = "module"
}

or

script(src = "index.js", type = "module") { }

JohannesOehm avatar Dec 27 '22 12:12 JohannesOehm