google/closure-compiler-js

--languageOut flag for CLI

o-t-w opened this issue · 1 comments

o-t-w commented

I am using NPM scripts as a build tool.

"minifyjs": "google-closure-compiler-js --languageOut=ES6 public/javascript/bundle-es6.js > public/javascript/bundle-min-es6.js ",
	"transpilejs": "google-closure-compiler-js --languageOut=ES5 public/javascript/bundle-es6.js > public/javascript/bundle-es5.js ",

In terminal I am getting the message Skipping pass checkConformance.
I'm getting some weird junk at the top of the uncompiled file,

pass supports: [ES3 keywords as identifiers, getters, reserved words as properties, setters, string continuation, trailing comma, block-scoped function declaration, const declaration, for-of loop, generator, let declaration]
current AST contains: [ES3 keywords as identifiers, getters, reserved words as properties, setters, string continuation, trailing comma, array pattern rest, arrow function, binary literal, block-scoped function declaration, class, computed property, const declaration, default parameter, destructuring, extended object literal, for-of loop, generator, let declaration, member declaration, new.target, octal literal, RegExp flag 'u', RegExp flag 'y', rest parameter, spread expression, super, template literal]
'use strict';(function(){function e(a,b,c,d){a.querySelector("[data-expandable-box]").style.height=c;a.querySelector("[data-expandable-box]").setAttribute("aria-hidden",!0);a.querySelector("button").setAttribute("aria-expanded",!1);a.querySelector("button span").textContent=d;a.classList.remove("js-expanded");a.dispatchEvent(g);b&&a.scrollIntoView()}function f(a,b){a.querySelector("[data-expandable-box]").style.height=null;a.querySelector("[data-expandable-box]").setAttribute("aria-hidden",!1);a.querySelector("button").setAttribute("aria-expanded",
!0);a.querySelector("button span").textContent=b;a.classList.add("js-expanded");a.dispatchEvent(h)}var h=new Event("open"),g=new Event("close");(function(a,b="200px",c="Show less",d="Show more"){a.forEach((a)=>{a.insertAdjacentHTML("beforeEnd",'\x3cdiv\x3e\x3cdiv\x3e\x3cbutton type\x3d"button" aria-expanded\x3d"false"\x3e\x3cspan\x3eShow more\x3c/span\x3e\x3c/button\x3e\x3c/div\x3e\x3c/div\x3e');a.isOpen=!1;e(a,!1,b,d);a.querySelector("button").addEventListener("click",function(){a.isOpen?(e(a,!0,
b,d),a.isOpen=!1):(f(a,c),a.isOpen=!0)});Array.from(a.getElementsByTagName("a")).forEach(function(b){b.addEventListener("focus",function(){f(a,c)})})})})([...document.querySelectorAll(".box")],void 0,"close","open");console.log("otherthing");console.log("this arrow function will be transpiled in older browsers, and untranspiled in newer browsers!")})();

Could you please improve your docs so its obvious how to use this correctly. Thanks