Closed magnusart closed 10 years ago
Hi Magnus,
Thanks for the heads up. It looks like there's a bug in the scoping here:
Your intuition of scoping against JsKeys,js
should work around the
problem:
(JsKeys.variableRenamingPolicy in (Compile, JsKeys,js)) :=
VariableRenamingPolicy.OFF
These JS-specific keys shouldn't be scoped by task. I'll work on fixing this in the next release.
Best regards,
Dave
On 7 January 2014 22:02, Magnus Andersson notifications@github.com wrote:
Hi
If I use sbt-js and set the configuration (JsKeys.variableRenamingPolicy in Compile) := VariableRenamingPolicy.OFF it makes no difference. The variables are still renamed to shorter names.
However if I change the configuration as follows (JsKeys.compilationLevel in (Compile, JsKeys.js)) := CompilationLevel.WHITESPACE_ONLY the variable names are not shortened.
I'm using AngularJS which is picky about this. Plugin version 0.6.
— Reply to this email directly or view it on GitHubhttps://github.com/untyped/sbt-plugins/issues/45 .
Dave Gurnell, Untyped http://untyped.com 07967 004805
Hi
I believe I tried that as well (JsKeys.variableRenamingPolicy in (Compile, JsKeys.js)) := VariableRenamingPolicy.OFF
but that didn't make any difference, or it's working but not in the way I expect.
Shouldn't the setting options.variableRenaming = variableRenamingPolicy
come after compilationLevel.setOptionsForCompilationLevel(options)
? Otherwise the compilation level will overwrite the settings.
Hi Thomas,
That sounds like a reasonable hypothesis. I'm tied up this weekend and next week -- if you can provide a test case and PR I'll merge it in as soon as I can. Otherwise it'll be a while until I can look into it.
Dave
On 2 May 2014 10:43, Thomas Dy notifications@github.com wrote:
Shouldn't the setting options.variableRenaming = variableRenamingPolicycome after compilationLevel.setOptionsForCompilationLevel(options)? Otherwise the compilation level will overwrite the settings.
Reply to this email directly or view it on GitHubhttps://github.com/untyped/sbt-plugins/issues/45#issuecomment-42010201 .
Dave Gurnell, Untyped http://untyped.com 07967 004805
PR merged with thanks.
Hi
If I use sbt-js and set the configuration
(JsKeys.variableRenamingPolicy in Compile) := VariableRenamingPolicy.OFF
it makes no difference. The variables are still renamed to shorter names.However if I change the configuration as follows
(JsKeys.compilationLevel in (Compile, JsKeys.js)) := CompilationLevel.WHITESPACE_ONLY
the variable names are not shortened.I'm using AngularJS which is picky about this. Plugin version 0.6.