-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
91 lines (84 loc) · 2.51 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
lazy val root = project
.in(file("."))
.enablePlugins(
ScalablyTypedConverterPlugin,
ScalaJSBundlerPlugin,
ScalaJSPlugin
)
.configure(
projectSettings,
slinkyBasics,
webpackSettings,
plotlyExample,
antdSettings
)
lazy val projectSettings: Project => Project =
_.settings(
name := "scalably-slinky-example",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.13.2",
webpackDevServerPort := 8023,
)
lazy val slinkyBasics: Project => Project =
_.settings(
scalacOptions += "-Ymacro-annotations",
requireJsDomEnv in Test := true,
addCommandAlias("dev", ";fastOptJS::startWebpackDevServer;~fastOptJS"),
addCommandAlias("build", "fullOptJS::webpack"),
libraryDependencies ++= Seq(
"me.shadaj" %%% "slinky-web" % "0.6.5",
"me.shadaj" %%% "slinky-hot" % "0.6.5"
),
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.1.1" % Test
),
Compile / npmDependencies ++= Seq(
"react" -> "16.13.1",
"react-dom" -> "16.13.1",
"react-proxy" -> "1.1.8"
),
Compile / npmDevDependencies ++= Seq(
"file-loader" -> "6.0.0",
"style-loader" -> "1.2.1",
"css-loader" -> "3.5.3",
"html-webpack-plugin" -> "4.3.0",
"copy-webpack-plugin" -> "5.1.1",
"webpack-merge" -> "4.2.2"
)
)
lazy val plotlyExample: Project => Project =
_.settings(
stFlavour := Flavour.Slinky,
useYarn := true,
stIgnore := List("react-proxy"),
Compile / npmDependencies ++= Seq(
"plotly.js" -> "1.57.1",
"react-plotly.js" -> "2.5.0",
"@types/react-plotly.js" -> "2.2.4",
"@types/react" -> "16.9.42",
"@types/react-dom" -> "16.9.8"
)
)
lazy val antdSettings: Project => Project =
_.settings(
Compile / npmDependencies ++= Seq(
"antd" -> "4.8.2"
)
)
lazy val webpackSettings: Project => Project =
_.settings(
version in webpack := "4.43.0",
version in startWebpackDevServer := "3.11.0",
webpackResources := baseDirectory.value / "webpack" * "*",
webpackConfigFile in fastOptJS := Some(
baseDirectory.value / "webpack" / "webpack-fastopt.config.js"
),
webpackConfigFile in fullOptJS := Some(
baseDirectory.value / "webpack" / "webpack-opt.config.js"
),
webpackConfigFile in Test := Some(
baseDirectory.value / "webpack" / "webpack-core.config.js"
),
webpackDevServerExtraArgs in fastOptJS := Seq("--inline", "--hot"),
webpackBundlingMode in fastOptJS := BundlingMode.LibraryOnly()
)