Skip to content

Project setup page is either unclear or wrong #599

Closed
@bwbecker

Description

@bwbecker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions