scala-js / scala-js-website

Source for https://www.scala-js.org/
259 stars 146 forks source link

Project setup page is either unclear or wrong #599

Closed bwbecker closed 1 year ago

bwbecker commented 1 year ago

The project setup page (https://www.scala-js.org/doc/project/) says the built.sbt file should look like

lazy val root = project.
  enablePlugins(ScalaJSPlugin)

However, when I do this and issue the run command, it doesn't generate any .sjsir files. I think it's running against the JVM.

However, when I change the suggested code to

lazy val root = project
    .in(file("."))
    .enablePlugins(ScalaJSPlugin)

it generates the .sjsir files.

Furthermore, the next page, Building the Application, suggests adding scalaJSUseMainModuleInitializer := true. Based on the Basic Tutorial and the information on the page, one might think that just inserting it at the top level of build.sbt would work. But it needs to go inside .settings:

lazy val root = project
    .in(file("."))
    .enablePlugins(ScalaJSPlugin)
    .settings(
       scalaJSUseMainModuleInitializer := true
   )

I would expect new users to find this confusing.