Questions tagged [google-closure-compiler]

Google Closure Compiler compiles a typed superset of modern JavaScript to a target version of JavaScript, applying type checking, dead code elimination, minification and other improvements.

The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.

The Closure Compiler has three optimization modes: whitespace only, simple optimizations, and advanced optimizations. The first two are safe for all JavaScript. The latter one imposes restrictions on JavaScript usage, but it is where Closure Compiler shines and the valuable type checking, dead code removal, and better minification.

1178 questions
-1
votes
2 answers

Error in Closure Compiler when compiling in advanced mode

When I use Closure Compiler I get the following errors when compiling in advanced mode: (in simple- and Whitespace only mode the code gets not problems at all) JSC_REDECLARED_VARIABLE: Redeclared variable: e at line 31 character 9 } catch (e) { …
Jason Stackhouse
  • 1,796
  • 2
  • 18
  • 19
-2
votes
1 answer

TwoFer program Bug

I ran into a problem while writing the TwoFer program This is the program's code public static class TwoFer { public static string Speak() { return "One for you, one for me."; } public static Speak(string h) { …
-2
votes
1 answer

Javascript closure compiler

I am learning to use google closure compiler for javascript but have strange compile error I get this message: ctest2.js:31: ERROR - [JSC_PARSE_ERROR] Parse error. '(' expected 31| testArray = []; ^ 1 error(s), 0 warning(s) If I…
Coder547
  • 119
  • 9
-2
votes
1 answer

Force closure compiler to preserve source line feeds

Google closure compiler removes all line feeds in advance mode. The PRETTY_PRINT option format the output again and PRINT_INPUT_DELIMITER does nothing. Is there any way to force it to keep all line feeds exactly like the source JS file so it's…
Ali
  • 21,572
  • 15
  • 83
  • 95
-2
votes
1 answer

Get Google closure compiler to work automatically instead of manually fixing IE8 parse errors

Wrote a script "LC.sh" to Download and compile a lambda Calculator to Javascript. Here's the relevant part of the script: [ ! -f ./compiler-latest.zip ] && echo "Downloading" && \ curl -R -O -L…
GlassGhost
  • 16,906
  • 5
  • 32
  • 45
-2
votes
1 answer

How to add saucy main universe package in ubuntu 12.04 lts server?

I want to install closure compiler on ubuntu., and dont knw how to include new packages in ubuntu.
-4
votes
1 answer

How to optimize a command-line node.js Javascript tool with the google closure compiler?

I am trying to optimize a command-line Javascript tool with the google closure compiler. I have the following Javascript source: // main.js console.log("test"); process.chdir("/"); console.log("arg: " + JSON.stringify(process.argv)); My flags file…
peterh
  • 11,875
  • 18
  • 85
  • 108
-5
votes
1 answer

Tsickle says "Error No inputs were found in config file" if I call it with tsconfig.json in a different directory

Calling tsickle with tsickle --externs=target/externs.js -- -p target/src I get this error: Error No inputs were found in config file 'target/src/tsconfig.json'. Specified 'include' paths were '["./my/pathes/**/*.ts"]' and 'exclude' paths were…
peterh
  • 11,875
  • 18
  • 85
  • 108
1 2 3
78
79