Skip to content

Commit 9a0b909

Browse files
committed
Remove scalajs-bundler
1 parent d012799 commit 9a0b909

File tree

4 files changed

+12
-24
lines changed

4 files changed

+12
-24
lines changed

build.sbt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ inThisBuild(
1616

1717
ThisBuild / versionScheme := Some("early-semver")
1818

19-
publish / skip := true
20-
2119
lazy val commonSettings = Seq(
2220
scalacOptions ++= {
2321
Seq(
@@ -45,8 +43,6 @@ lazy val commonSettings = Seq(
4543
)
4644
)
4745

48-
lazy val commonPlugins = Seq()
49-
5046
lazy val bindings = project
5147
.in(file("bindings"))
5248
.settings(commonSettings: _*)
@@ -59,9 +55,7 @@ lazy val bindings = project
5955
),
6056
scalaJSUseMainModuleInitializer := true
6157
)
62-
.enablePlugins(commonPlugins: _*)
6358
.enablePlugins(ScalaJSPlugin)
64-
.enablePlugins(ScalaJSBundlerPlugin)
6559

6660
lazy val plugin = project
6761
.in(file("sbt-plugin"))
@@ -77,7 +71,12 @@ lazy val plugin = project
7771
"org.scalatest" %% "scalatest" % "3.2.11" % "test"
7872
)
7973
},
80-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0"),
81-
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0")
74+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
75+
)
76+
77+
val root = project
78+
.in(file("."))
79+
.aggregate(bindings, plugin)
80+
.settings(
81+
publish / skip := true
8282
)
83-
.enablePlugins(commonPlugins: _*)

project/plugins.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
2-
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0")
32
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
43
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")

sbt-plugin/src/main/scala/com/alexitc/Chrome.scala

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ object Chrome {
1515
}.toMap
1616
}
1717

18-
// TODO: I'm not sure if the jsDeps are actually useful but I'm keeping those just because
19-
// the original plugin had them, now that we use scalajs-bundler, it can be that we need
20-
// to re-work the source maps strategy for js dependencies
21-
def buildUnpackedDirectory(
22-
unpacked: File
23-
)(manifest: File, jsLib: File, jsDeps: Seq[File], resources: Seq[File]): File = {
24-
val libsAndDependencies =
25-
List(jsLib -> unpacked / jsLib.getName) ++ jsDeps.map(file => file -> unpacked / file.getName)
18+
def buildUnpackedDirectory(unpacked: File)(manifest: File, jsLib: File, resources: Seq[File]): File = {
19+
val libsAndDependencies = List(jsLib -> unpacked / jsLib.getName)
2620

27-
val sourceMaps = (List(jsLib) ++ jsDeps)
21+
val sourceMaps = List(jsLib)
2822
.map { sourceFile =>
2923
val fileName = sourceFile.getName + ".map"
3024
val originalSourceMap = sourceFile.getParentFile / fileName

sbt-plugin/src/main/scala/com/alexitc/ChromeSbtPlugin.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import org.scalajs.sbtplugin.ScalaJSPlugin
55
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport.*
66
import sbt.*
77
import sbt.Keys.*
8-
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin
9-
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport.*
108

119
object ChromeSbtPlugin extends AutoPlugin {
1210

13-
override def requires: Plugins = ScalaJSPlugin && ScalaJSBundlerPlugin
11+
override def requires: Plugins = ScalaJSPlugin
1412

1513
object autoImport {
1614

@@ -30,7 +28,6 @@ object ChromeSbtPlugin extends AutoPlugin {
3028
Chrome.buildUnpackedDirectory(target.value / chromeDir / "unpacked-fast")(
3129
(Compile / chromeGenerateManifest).value,
3230
fastOptJsLib.value.data,
33-
(Compile / fastOptJS / webpack).value.map(_.data),
3431
(Compile / resourceDirectories).value
3532
)
3633
},
@@ -39,7 +36,6 @@ object ChromeSbtPlugin extends AutoPlugin {
3936
Chrome.buildUnpackedDirectory(target.value / chromeDir / "unpacked-opt")(
4037
(Compile / chromeGenerateManifest).value,
4138
fullOptJsLib.value.data,
42-
(Compile / fullOptJS / webpack).value.map(_.data),
4339
(Compile / resourceDirectories).value
4440
)
4541
},

0 commit comments

Comments
 (0)