Setup example module with JS bundle configured

This commit is contained in:
Paul-Henri Froidmont 2025-08-21 18:19:08 +02:00
parent 486e89c1f1
commit aae3db841b
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
7 changed files with 39 additions and 7 deletions

11
core/js/src/index.ts Normal file
View file

@ -0,0 +1,11 @@
import morphdom from 'morphdom';
var el1 = document.createElement('div');
el1.className = 'foo';
var el2 = document.createElement('div');
el2.className = 'bar';
morphdom(el1, el2);
export const scalive = "scalive"

View file

@ -3,6 +3,9 @@ import scalive.defs.complex.ComplexHtmlKeys
import scalive.defs.tags.HtmlTags
package object scalive extends HtmlTags with HtmlAttrs with ComplexHtmlKeys:
lazy val defer = htmlAttr("defer", codecs.BooleanAsOnOffStringCodec)
implicit def stringToMod(v: String): Mod = Mod.Content.Text(v)
implicit def htmlElementToMod(el: HtmlElement): Mod = Mod.Content.Tag(el)
implicit def dynStringToMod(d: Dyn[String]): Mod = Mod.Content.DynText(d)