-
Notifications
You must be signed in to change notification settings - Fork 146
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
Improve GCC/ Minifier documentation #645
Comments
Yes. Also, the config is documented in source: Seems like the scaladoc comments are not in the right place. We should obviously fix that. |
I do not think the GCC stops being used unless I use |
Ah, right. I think you need to scope it in the config as well:
|
Confirmed, with Why is the I am checking some other basic documentation and tutorials. If you clone https://github.com/scala-js/scalajs-tutorial, it uses ancient versions of sbt and Scala.js, IntelliJ is unable to import the project. I can prepare PR for that if desired. A bit related: it seems the minifier assumes some other JS minification will be done later in the pipeline, at least its ScalaDoc says so. Would this also be in scope of the Basic Tutorial? |
Because of how we configure the fullLink config: You'll notice this is scoped in both the configuration and the task. I guess at some point in the past, we decided (explicitly or implicitly) it's more important to be able to re-configure configs easily then re-configure fast v.s. full defaults easily. (I'm making the assumption here that sbt axis are not hierarchical but I believe this is the case).
Always appreciated. Please do note that the commit structure of that repo is a bit odd: The commits correspond to steps. So you essentially need to rewrite its entire history to update it.
IMO no. The basic tutorial is officially "old" (as you can see from the Tutorial Overview). The Scala.js and Vite tutorial does perform JS minification (or more precisely Vite's production build does). |
Thanks for the explanation.
Still unclear about |
First, always use Second, just |
Explanation is good, but the main point of this issue is to improve documentation so that the explanation here is not necessary. Besides the links I have provided, some related documentation seems to be present in https://www.scala-js.org/doc/project/building.html as well. However I doubt I want to have this in my SBT:
I would almost certanly want to disable optimizer for |
I have tried it now with the Scala.js Tutorial project. This affects
This does not:
|
Regarding the doc of StandardConfig: I've attempted to move the doc comments to |
I would like to experiment with the new minifier a bit. How can I control if the new minifier or GCC is used?
I find the documentation about
scalaJSLinkerConfig
a bit lacking, esp. when Google often shows me pages which are quite old.The documentation I am aware of:
https://www.scala-js.org/doc/project/module.html
https://www.scala-js.org/doc/internals/compile-opt-pipeline.html
scala-js/scala-js#4482 mentions:
There is no more explanation.
In LinkerBackendImpl.scala I can see some functions which look they might do something:
withClosureCompilerIfAvailable
withMinify
Similar properties can be seen in https://www.scala-js.org/api/scalajs-linker-interface-js/latest/org/scalajs/linker/interface/StandardConfig.html, but there is no documentation for them.
I guess when I want to use the new minifier I want:
The text was updated successfully, but these errors were encountered: