Skip to content
This repository has been archived by the owner on Mar 31, 2018. It is now read-only.

Commit

Permalink
Use the automatically generated launcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrd committed Jun 13, 2014
1 parent 45de74a commit b4cf28f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 4 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ version := "0.1-SNAPSHOT"

scalaVersion := "2.11.1"

ScalaJSKeys.persistLauncher := true

ScalaJSKeys.persistLauncher in Test := false

libraryDependencies ++= Seq(
"org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6",
"org.scala-lang.modules.scalajs" %% "scalajs-jasmine-test-framework" % scalaJSVersion % "test"
Expand Down
5 changes: 1 addition & 4 deletions index-fastopt.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ <h1>Example Scala.js application - fast-optimized version</h1>
</div>

<script type="text/javascript" src="./target/scala-2.11/example-fastopt.js"></script>

<script type="text/javascript">
ScalaJSExample().main();
</script>
<script type="text/javascript" src="./target/scala-2.11/example-launcher.js"></script>

</body>
</html>
5 changes: 1 addition & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ <h1>Example Scala.js application - full-optimized version</h1>
</div>

<script type="text/javascript" src="./target/scala-2.11/example-opt.js"></script>

<script type="text/javascript">
ScalaJSExample().main();
</script>
<script type="text/javascript" src="./target/scala-2.11/example-launcher.js"></script>

</body>
</html>
4 changes: 1 addition & 3 deletions src/main/scala/example/ScalaJSExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import scala.scalajs.js
import js.annotation.JSExport
import org.scalajs.dom

@JSExport
object ScalaJSExample {
@JSExport
object ScalaJSExample extends js.JSApp {
def main(): Unit = {
val paragraph = dom.document.createElement("p")
paragraph.innerHTML = "<strong>It works!</strong>"
Expand Down

0 comments on commit b4cf28f

Please sign in to comment.