Skip to content
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

[error] WARN: Collapsing variable] #32

Open
Fenwick17 opened this issue Mar 15, 2019 · 2 comments
Open

[error] WARN: Collapsing variable] #32

Fenwick17 opened this issue Mar 15, 2019 · 2 comments

Comments

@Fenwick17
Copy link

I have some JavaScript that I am minifying with sbt-uglify. However it is throwing a few warnings regard ing [error] WARN: Collapsing variable. When I look at the JS it is perfectly valid and theres no issues, for example.

var tokens = text.match(/\S+/g) || [];
length = tokens.length;

Is there a way I can tell sbt-uglify to not provide those warnings?

@Baboly3
Copy link

Baboly3 commented May 25, 2020

Hi,

want to turn this off also, how can i do that?

@Baboly3
Copy link

Baboly3 commented Mar 4, 2021

Had some time over to sitt with this again, solved it!

in build.sbt make a settingKey and use it on uglifyCompressOptions.

val turnoffJSUglifyWarningsTask = SettingKey[Seq[String]]("sbt-uglify turn off console output")
turnoffJSUglifyWarningsTask := Seq( "drop_console=true, warnings=false")

and then in project settings

uglifyCompressOptions := (turnoffJSUglifyWarningsTask).value

You only need "warnings=false" but i put "drop_console" also.

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

No branches or pull requests

2 participants