google-closure-compiler

Does GWT reuse Google Closure Compiler, and why if not?

流过昼夜 提交于 2019-12-23 23:10:56
问题 Google Web Toolkit (GWT) performs inlining of javascript code, minifying and removing unused code, and some other optimizations which are also done by Google Closure Compiler. So I was wondering if Closure Compiler is in fact utilized in GWT or do they have two separate implementations? If so, then what is the restriction/reasoning for not reusing Google Closure Compiler in GWT? 回答1: Commit 10778: Closure JS hookup hooks GWT to the closure compiler. Probably with GWT 2.5, at least behind the

including Closure Compiler into an asp.net app using command line

☆樱花仙子☆ 提交于 2019-12-23 20:31:57
问题 I have a method that I call on PageLoad of an aspx (the method will later be moved to a file in the AppCode dir) that looks like this: public partial class PagesSystem_TestGCC : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string strCmdText; strCmdText = "/K java -jar c:\\TheSite\\compiler.jar --js c:\\TheSite\\JSTest\\hello.js --js_output_file c:\\TheSite\\JSTest\\hello-compiled.js"; System.Diagnostics.Process.Start("CMD.exe", strCmdText); } } The problem is

Make source maps refer to original files on remote machine

那年仲夏 提交于 2019-12-23 20:11:56
问题 Using Google Closure Compiler to minify a bunch of javascripts. Now I'd like to also add source maps to those to debug out in the wild. Thing is, I want to keep the original (and preferrably also the map files) on a completely different place, like another server. I've been looking for a solution to this, and found out about the sourceRoot parameter. But it seems as it's not supported? Also found this --source_map_location_mapping parameter, but no documentation whatsoever. Seems as it wants

What is the best way to export library method, when using Closure Compiler?

断了今生、忘了曾经 提交于 2019-12-23 19:08:42
问题 Closure Compiler documentation clearly states: "Don't use Externs instead of Exports". Because Externs are very handy to use, I came down with a problem: function Lib(){ //some initialization } Lib.prototype = { invoke : function(str){ //this function is called from outside to invoke some of Lib's events } } When using Closure Compiler with ADVANCED_OPTIMIZATIONS , function invoke is removed from the source. This could be prevented in two ways: Adding the line after prototype definition: Lib

When to use typedef in closure?

不问归期 提交于 2019-12-23 12:37:57
问题 I have been confused for a long time regarding the following code snippet: /** * Pair of width and height. * @param {string} width * @param {string} height * @constructor * @struct */ var Pair = function(width, height) { /** @type {string} */ this.key = key; /** @type {string} */ this.value = value; }; vs /** * @typedef {{width: string, height: string}} */ var Pair; Basically I need to create a new type and highly confused about which one to use when? 回答1: which one to use when? This is to

One click closure windows tool to compile all js files in folder

强颜欢笑 提交于 2019-12-23 12:16:35
问题 Is there a tool or a bat file or some such that allows one click to compile all js files inside a folder into one compiled js file? Thanks. 回答1: Google's Page Speed tool has a Closure Compiler integration that will automatically compile your site's Javascript for you. You can find more information on Page Speed and its Closure integration here: http://code.google.com/speed/page-speed/download.html 来源: https://stackoverflow.com/questions/1772889/one-click-closure-windows-tool-to-compile-all-js

Google closure compiler usage WebStorm

*爱你&永不变心* 提交于 2019-12-23 09:48:53
问题 I like to use the Google Closure Compiler in WebStorm. I've downloaded it over npm. npm install closure Never really used node and i don't know how to execute the commandline. Please do not blame me. Knowledge don't came from nowhere and this question is programming related. 回答1: You have to put the path to the Closure compiler .jar there, the default arguments which phpstorm gives you are fine. I did not install closure compiler via node.js, but I did it with coffeescript and it should be

Exposing dynamically created functions on objects with closure compiler

大城市里の小女人 提交于 2019-12-23 03:58:20
问题 I am trying to annotate my javascript so that closure doesnt rename all the symbols since i am working with vanilla javascript as well. /** * @constructor * @expose * @type{foo} */ foo = function (el, args) { "use strict"; var s = "Hello World"; /* * @expose * @this {foo} * @type {function} */ this.introduce = function () { return s; }; }; However the generated output when i run it through the closure compiler with advanced optimization is foo = function() { this.a = function() { return"Hello

Closure Compiler - {SyntheticVarsDeclar}: WARNING - Redeclared variable

女生的网名这么多〃 提交于 2019-12-22 18:37:22
问题 I am using Closure Compiler with --warning_level=VERBOSE and --compilation_level ADVANCED_OPTIMIZATIONS It outputs: {SyntheticVarsDeclar}: WARNING - Redeclared variable: i 0 error(s), 1 warning(s) Is there a way to find out more information about where this i variable is declared? //Update I have run through every i variable in all the files and there is none that are redeclared. Here is a list of flags being used: --jscomp_off=externsValidation --summary_detail_level=3 --warning_level

Use Closure Compiler with AngularJS in ADVANCED_MODE

风格不统一 提交于 2019-12-22 11:35:49
问题 I'm trying to compile one of our angular & openLayers project but I'm not able to use Angular. I've put the angular external parameter, but after compiling i get this error : Error: [$injector:unpr] Unknown provider: aProvider <- a <- myCtrl http://errors.angularjs.org/1.3.15/$injector/unpr?p0=aProvider%20%3C-%20a%20%3C-%20myCtrl at REGEX_STRING_REGEXP (angular.js:63) at angular.js:4015 at Object.getService [as get] (angular.js:4162) at angular.js:4020 at getService (angular.js:4162) at