From cb5f9731267e73c1e17e5b7e43305ffd8ad8fd0d Mon Sep 17 00:00:00 2001 From: reidspencer Date: Fri, 4 Oct 2024 08:58:33 -0400 Subject: [PATCH] Set up scalaJSLinkerConfig without regard for hasMain parameter. --- .../com/ossuminc/sbt/helpers/Javascript.scala | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/scala/com/ossuminc/sbt/helpers/Javascript.scala b/src/main/scala/com/ossuminc/sbt/helpers/Javascript.scala index 54cdfac..afb7582 100644 --- a/src/main/scala/com/ossuminc/sbt/helpers/Javascript.scala +++ b/src/main/scala/com/ossuminc/sbt/helpers/Javascript.scala @@ -22,20 +22,16 @@ object Javascript extends AutoPluginHelper { // for an application with a main method scalaJSUseMainModuleInitializer := hasMain, scalaJSLinkerConfig ~= { - if (hasMain) { - _.withOptimizer(forProd) - } else { - _.withOptimizer(forProd) - .withModuleKind({ - if (withCommonJSModule) { - ModuleKind.CommonJSModule - } else { - ModuleKind.ESModule - } - }) - .withSourceMap(true) - .withJSHeader("// " + header + "\n") - } + _.withOptimizer(forProd) + .withModuleKind({ + if (withCommonJSModule) { + ModuleKind.CommonJSModule + } else { + ModuleKind.ESModule + } + }) + .withSourceMap(!forProd) + .withJSHeader("// " + header + "\n") }, libraryDependencies ++= Seq( "io.github.cquiroz" %%% "scala-java-time" % "2.6.0",