WebPlotDigitizer icon indicating copy to clipboard operation
WebPlotDigitizer copied to clipboard

Better parameters to Closure Compiler

Open KOLANICH opened this issue 6 years ago • 5 comments

From 224ed033c4e1d355ee57a136b25c81b022d933e9 Mon Sep 17 00:00:00 2001
From: KOLANICH
Date: Fri, 9 Feb 2018 13:07:16 +0300
Subject: Better parameters to closure compiler.

---
 app/build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/build.sh b/app/build.sh
index e17af29..f61c4e5 100755
--- a/app/build.sh
+++ b/app/build.sh
@@ -11,7 +11,7 @@ cat javascript/services/*.js >> combined.js
 cat javascript/controllers/*.js >> combined.js
 
 echo "Compiling Javascript Files..."
-java -jar thirdparty/closure-compiler/compiler.jar --js combined.js --js_output_file combined-compiled.js
+java -jar thirdparty/closure-compiler/compiler.jar --js combined.js --js_output_file combined-compiled.js --language_in ECMASCRIPT6_TYPED --language_out ECMASCRIPT5 --use_types_for_optimization --new_type_inf --rewrite_polyfills=false
 echo "done."
 
 echo "Update translation files..."
--

KOLANICH avatar Feb 09 '18 10:02 KOLANICH

Sounds good 👍

ankitrohatgi avatar Feb 10 '18 01:02 ankitrohatgi

Why have this not been applied then?

KOLANICH avatar Feb 10 '18 07:02 KOLANICH

While these arguments are good, I don't get a working code at the end. It will take quite some time to fix the code to get this in. This will have to wait.

ankitrohatgi avatar Feb 10 '18 16:02 ankitrohatgi

For me (I use Firefox) the generated code works. And the parameters are not good - they are useless since I have forgotten to enable ADVANCED optimization level.

KOLANICH avatar Feb 10 '18 17:02 KOLANICH

Btw, I'm open to switching out closure compiler to any ES6 minifier. It seems most new browsers support everything, so no point compiling to ES5. If you have a recommendation, then I can check it out.

ankitrohatgi avatar Jun 18 '18 15:06 ankitrohatgi