-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
39 lines (32 loc) · 1.56 KB
/
build.sbt
File metadata and controls
39 lines (32 loc) · 1.56 KB
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
31
32
33
34
35
36
37
38
39
import sbt.IO
name := "scala-js-plotlyjs-demo"
scalaVersion := "3.5.0"
val poltlyjsVersion = "1.8.1"
val scaladgetVersion = "1.11.0"
val laminarVersion = "16.0.0"
resolvers += Resolver.bintrayRepo("definitelyscala", "maven")
//resolvers += Resolver.sonatypeOssRepos _//sonatypeRepo("snapshots")
resolvers += Resolver.jcenterRepo
lazy val runDemo = taskKey[Unit]("runDemo")
lazy val demo = project.in(
file(".")
) enablePlugins (ScalaJSBundlerPlugin) settings (
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.8.0",
libraryDependencies += "com.raquo" %%% "laminar" % laminarVersion,
libraryDependencies += "org.openmole.scaladget" %%% "bootstrapnative" % scaladgetVersion,
libraryDependencies += "org.openmole.scaladget" %%% "highlightjs" % scaladgetVersion,
libraryDependencies += "org.openmole.scaladget" %%% "svg" % scaladgetVersion,
libraryDependencies += "org.openmole" %%% "scala-js-plotlyjs" % poltlyjsVersion,
libraryDependencies += "com.lihaoyi" %%% "sourcecode" % "0.4.2",
scalaJSLinkerConfig := scalaJSLinkerConfig.value.withSourceMap(false),
webpackNodeArgs := Seq("--openssl-legacy-provider"),
scalaJSUseMainModuleInitializer := true,
Compile / npmDependencies += "plotly.js" -> "2.13.3",
runDemo := {
val demoResource = (Compile / resourceDirectory).value
val jsBuild = (Compile / fastOptJS / webpack).value.head.data
IO.copyFile(jsBuild, target.value / "js/demoplotly.js")
// IO.copyFile(crossTarget.value / s"${name.value}-jsdeps.js", target.value / "js/deps.js")
IO.copyDirectory(demoResource, target.value)
}
)