Skip to content

Improve GCC/ Minifier documentation #645

Open
@OndrejSpanel

Description

@OndrejSpanel

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:

We automatically enable the new minifier under fullLink when GCC is disabled. This can be overridden with a scalaJSLinkerConfig setting.

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:

fullOptJS / scalaJSLinkerConfig ~= (_.withClosureCompiler(false).withMinify(true))

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