-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
65 lines (53 loc) · 1.76 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.nio.file.StandardCopyOption
import org.scalajs.sbtplugin.ScalaJSPlugin.AutoImport.fastOptJS
resolvers += Resolver.bintrayRepo("oyvindberg", "ScalablyTyped")
enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSBundlerPlugin)
name := "Simple Tutorials"
scalaVersion := "2.12.7" // or any other Scala version >= 2.10.2
webpackBundlingMode := BundlingMode.LibraryAndApplication()
webpackConfigFile := Some(baseDirectory.value / "my.custom.webpack.config.js")
libraryDependencies ++= Seq(
ScalablyTyped.P.`plotly_dot_js`,
ScalablyTyped.M.`mathjs`,
ScalablyTyped.M.`mathjax`,
ScalablyTyped.O.`ol`,
// ScalablyTyped.J.`jquery`,
// ScalablyTyped.S.`semantic-ui`,
)
npmDependencies in Compile ++= Seq(
"plotly.js" -> "1.47.2",
"mathjs" -> "5.0",
"ify-loader" -> "1.1.0",
"ol" -> "4.6.4",
"openlayers" -> "4.6.5",
// "mathjax" -> "2.7.2", // provided by the Github Pages Theme
// "jquery" -> "1.0.4",
// "semantic-ui" -> "2.2",
)
libraryDependencies ++= Seq(
"com.thoughtworks.binding" %%% "dom" % "latest.release",
"be.doeraene" %%% "scalajs-jquery" % "0.9.1"
)
addCompilerPlugin(
"org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full
)
lazy val copyTask = taskKey[Unit]("copyJS")
copyTask := {
val bundle = (Compile / fastOptJS / webpack).value.head
val destinationPath =
file(s"docs/assets/javascripts/${bundle.data.name}").toPath
java.nio.file.Files.copy(
bundle.data.toPath,
destinationPath,
StandardCopyOption.REPLACE_EXISTING
)
val destinationPathMap =
file(s"docs/assets/javascripts/${bundle.data.name}.map").toPath
val sourcePathMap = file(s"${bundle.data.toPath}.map").toPath
java.nio.file.Files.copy(
sourcePathMap,
destinationPathMap,
StandardCopyOption.REPLACE_EXISTING
)
}