File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ object WebAppModuleTests extends TestSuite:
3838 val html = os.read(siteDir / " index.html" )
3939
4040 // 1. Must NOT reference the static unhashed name
41- assert(! html.contains(" src=\" /main.js\" " ))
41+ assert(! html.contains(" src=\" . /main.js\" " ))
4242
4343 // 2. Extract all <script src="..."> references from the HTML
44- val scriptSrcPattern = """ src="/([^"]+\.js)"""" .r
44+ val scriptSrcPattern = """ src="\. /([^"]+\.js)"""" .r
4545 val scriptRefs = scriptSrcPattern.findAllMatchIn(html).map(_.group(1 )).toList
4646 if scriptRefs.isEmpty then
4747 throw new java.lang.AssertionError (s " No <script src=...> found in index.html: \n $html" )
@@ -180,7 +180,7 @@ object WebAppModuleTests extends TestSuite:
180180 end if
181181
182182 // Extract all <script src="..."> references
183- val scriptSrcPattern = """ src="/([^"]+\.js)"""" .r
183+ val scriptSrcPattern = """ src="\. /([^"]+\.js)"""" .r
184184 val scriptRefs = scriptSrcPattern.findAllMatchIn(html).map(_.group(1 )).toList
185185 if scriptRefs.isEmpty then
186186 throw new java.lang.AssertionError (s " No <script src=...> found in publish index.html: \n $html" )
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ trait ScalaJsRefreshModule extends ScalaJSConfigModule:
4646
4747 def titleString : String = " App"
4848
49- def bodyHtmlFromReport (report : Report , basePath : String = " /" , includeRefresh : Boolean = false ): String =
49+ def bodyHtmlFromReport (report : Report , basePath : String = " . /" , includeRefresh : Boolean = false ): String =
5050 val scriptTags = report.publicModules.map(m => script(src := s " $basePath${m.jsFileName}" , `type` := " module" ))
5151 body(
5252 frag(scriptTags.toSeq* ),
You can’t perform that action at this time.
0 commit comments