-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.sbt
30 lines (25 loc) · 1.16 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import org.scalajs.linker.interface.ModuleSplitStyle
lazy val `test-vite` = project.in(file("."))
.enablePlugins(ScalaJSPlugin) // Enable the Scala.js plugin in this project
.enablePlugins(ScalablyTypedConverterExternalNpmPlugin)
.settings(
scalaVersion := "3.3.1",
scalacOptions ++= Seq("-encoding", "utf-8", "-deprecation", "-feature"),
// Tell Scala.js that this is an application with a main method
scalaJSUseMainModuleInitializer := true,
/* Configure Scala.js to emit modules in the optimal way to
* connect to Vite's incremental reload.
* - emit ECMAScript modules
* - emit as many small modules as possible for classes in the "testvite" package
* - emit as few (large) modules as possible for all other classes
* (in particular, for the standard library)
*/
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule)
.withModuleSplitStyle(ModuleSplitStyle.SmallModulesFor(List("testvite")))
},
// Depend on Laminar
libraryDependencies += "com.raquo" %%% "laminar" % "15.0.1",
// Tell ScalablyTyped that we manage `npm install` ourselves
externalNpm := baseDirectory.value,
)