Home

Awesome

All-in-One Scala.js Static Web Project Template

Open in Gitpod Scala CI

This repository is a template of the basic structure for a Scala.js web project, contains all the best technologies in Scala.js community until 2023:

Note that the default branch of this repository is written in Scala 3. Check out the scala-2.13 branch for a project template in Scala 2.13.

Other libraries and tools can be found in sbt settings.

This template contains settings for a static web project, and you can additionally configure Play or Akka HTTP dependencies in web/build.sbt to turn it into a dynamic web project.

Directory Structure

Requirements

How to use this template?

Just clone this repository, and the following sbt tasks are available.

Build

Run the following command:

sbt assets

Then visit web/target/web/public/main/devMod.html to browse the main page.

Release mode build

By default, the assets command builds Scala.js in development mode. To build this project in release mode

sbt "set scalaJSStage := FullOptStage" assets

Then visit web/target/web/public/main/index.html to browse the main page in release mode.

Test

Run the following command:

sbt test

Then the examples in Scaladoc comments will be ran by ScalaTest.