diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index dd8ab30..c6ef4e1 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -4,7 +4,7 @@ name: Deploy static content to Pages on: # Runs on pushes targeting the default branch push: - branches: ["master"] + branches: ["master", "fix-live-demo"] paths-ignore: - "**/*.md" @@ -46,8 +46,8 @@ jobs: run: | cd example/client npm install - - name: ScalaJS build - run: sbt example-client/fastLinkJS +# - name: ScalaJS build +# run: sbt example-client/fastLinkJS - name: Vite build run: | cd example/client diff --git a/build.sbt b/build.sbt index f6f8906..414422b 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ //import ProjectDef._ +import java.nio.charset.StandardCharsets import org.scalajs.linker.interface.ModuleSplitStyle val scala33 = "3.3.1" @@ -177,3 +178,22 @@ def scalajsProject(projectId: String, folder: Option[String] = None): Project = "-Xfatal-warnings" ) ) + +Global / onLoad := { + val scalaVersionValue = (example / scalaVersion).value + val outputFile = + baseDirectory.value / "example" / "client" / "scala-metadata.js" + IO.writeLines( + outputFile, + s""" + |const scalaVersion = "$scalaVersionValue" + | + |exports.scalaMetadata = { + | scalaVersion: scalaVersion + |} + |""".stripMargin.split("\n").toList, + StandardCharsets.UTF_8 + ) + + (Global / onLoad).value +} diff --git a/example/client/index.html b/example/client/index.html index 173641e..f13fb16 100644 --- a/example/client/index.html +++ b/example/client/index.html @@ -3,20 +3,18 @@
- + - - + -