File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 runs-on : ${{ matrix.os }}
2828 timeout-minutes : 60
2929 steps :
30+ - uses : taiki-e/install-action@just
31+ - uses : coursier/cache-action@v8
3032 - uses : coursier/setup-action@main
3133 with :
3234 jvm : temurin@21
9799 fetch-depth : 0
98100 fetch-tags : true
99101
102+ - uses : coursier/cache-action@v8
100103 - uses : coursier/setup-action@main
101104 with :
102105 jvm : temurin@21
@@ -130,6 +133,7 @@ jobs:
130133 needs : build
131134 runs-on : ubuntu-latest
132135 steps :
136+ - uses : coursier/cache-action@v8
133137 - uses : coursier/setup-action@main
134138 with :
135139 jvm : temurin@21
Original file line number Diff line number Diff line change @@ -79,12 +79,13 @@ object SiteJsTests extends TestSuite:
7979 }
8080 }
8181
82- test(" Import map populated from sub task" ) {
82+ /** YAML friendly overrides
83+ */
84+ test(" Import map and smallModulesFor populated from sub task" ) {
8385 object build extends TestRootModule with ScalaJsRefreshModule :
8486 override def scalaVersion : Simple [String ] = " 3.8.2"
85- override def moduleSplitStyle : Simple [ModuleSplitStyle ] =
86- ModuleSplitStyle .SmallModulesFor (" webapp" )
8787
88+ override def smallModulesFor = Seq (" webapp" )
8889 override def mvnDeps = Seq (
8990 mvn " com.raquo::laminar::17.0.0 "
9091 )
@@ -106,6 +107,10 @@ object SiteJsTests extends TestSuite:
106107 prefix == " @foo" && target == " https://cdn.skypack.dev/foo/"
107108 case _ => throw new java.lang.AssertionError (s " Unexpected import mapping type: $report" )
108109 })
110+
111+ val Right (smallModulesResult) = eval(build.smallModulesFor).runtimeChecked
112+ val smallModules = smallModulesResult.value
113+ assert(smallModules.contains(" webapp" ))
109114 }
110115
111116 }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import mill.scalajslib.api.ModuleKind
1717import mill .scalajslib .api .Report
1818import mill .scalajslib .config .ScalaJSConfigModule
1919import mill .scalajslib .api .ESModuleImportMapping
20+ import mill .scalajslib .api .ModuleSplitStyle
2021implicit val ec : scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext .global
2122
2223/** Base Mill plugin trait for Scala.js applications served by sjsls during development.
@@ -74,6 +75,12 @@ trait ScalaJsRefreshModule extends ScalaJSConfigModule:
7475 .toSeq
7576 end scalaJSImportMap
7677
78+ def smallModulesFor = Task (Seq .empty[String ])
79+
80+ override def moduleSplitStyle : Simple [ModuleSplitStyle ] = Task {
81+ ModuleSplitStyle .SmallModulesFor (smallModulesFor()* )
82+ }
83+
7784 /** DOM id of the root node your application will mount into. */
7885 def appRoot : String = " app"
7986
You can’t perform that action at this time.
0 commit comments