Skip to content

Fix #9783: Scala.js: Implement the -scalajs-mapSourceURI option. #10439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2020

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Nov 21, 2020

We apply it to the scala3-library-bootstrappedJS project, so that source maps can correctly work for the Scala 3 library.

Additionally, it serves as a smoke test.

We apply it to the scala3-library-bootstrappedJS project, so that
source maps can correctly work for the Scala 3 library.

Additionally, it serves as a smoke test.
@sjrd sjrd removed the request for review from niktrop November 21, 2020 21:29
@sjrd sjrd added this to the 3.0.0-M2 milestone Nov 22, 2020
@sjrd sjrd merged commit e14c765 into scala:master Nov 22, 2020
@sjrd sjrd deleted the sjs-map-source-uri branch November 22, 2020 08:55
@@ -67,6 +67,7 @@ class ScalaSettings extends Settings.SettingGroup {

/** Scala.js-related settings */
val scalajsGenStaticForwardersForNonTopLevelObjects: Setting[Boolean] = BooleanSetting("-scalajs-genStaticForwardersForNonTopLevelObjects", "Generate static forwarders even for non-top-level objects (Scala.js only)")
val scalajsMapSourceURI: Setting[List[String]] = MultiStringSetting("-scalajs-mapSourceURI", "uri1[->uri2]", "rebases source URIs from uri1 to uri2 (or to a relative URI) for source maps (Scala.js only)")
Copy link
Member

@smarter smarter Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To simplify cross-compilation and not have to update the existing documentation, would it make sense to make -P:scalajs:foo an alias of -scalajs-foo ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would we do that? -P is a generic system to pass options to a plugin. We would have to special case scalajs in several places.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at how -P works so I can't say, but it seems like even if it's a bit hacky it would be worth it, but I don't know, your choice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants