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
0
votes
1 answer

Why are my Angular, absolute path, URL's not compiling properly with Closure Compiler?

Take the following example directive: .directive("myDirective", function() { return { restrict: "A", templateUrl: "/my/absolute/path.tmplt.html", controller: ...Do Controller Stuff... } }); This runs through the…
dpsthree
  • 2,225
  • 4
  • 21
  • 23
0
votes
1 answer

How to annotate classes with Closure Compiler/JSDoc?

I cannot seem to annotate a class so that its methods are know to the WebStorm editor. Here is the example: /** * @class my class * @constructor */ function MyClass() { this.aPublicField = "foo" var aPrivateField = "bar" …
fusio
  • 3,595
  • 6
  • 33
  • 47
0
votes
1 answer

How do I install kbuild?

How do I run/install this: https://github.com/kevmoo/kbuild? I installed the dependencies and tried to execute the bin/kbuild Python script, but it's giving me this error: Traceback (most recent call last): File "kbuild/bin/kbuild", line 12, in…
user396070
0
votes
0 answers

Play! Framework 2.1.1 and Google Closure - SIMPLE_OPTIMIZATIONS

I want to use Simple Optimization from Google Closure in Play! (using Scala) I searched a while now for solutions to do that. First thing I found is to put following in Build.scala: val main = play.Project(appName, appVersion,…
0
votes
1 answer

Video.js Build on Windows Hangs on Minify Task

I'm trying to follow the contributing instructions for Video.js, and when I attempt to build the project grunt hangs on the minify step. Here's the output: Running "minify" task Running "minify:source" (minify) task Verifying property minify.source…
Dominic P
  • 2,284
  • 2
  • 27
  • 46
0
votes
1 answer

cURL postfields issue

I'm trying to work with Google's Closure Compiler, unfortunately I stumbled upon a problem with cURL's postfields. It seems to be that when I specify an array here, it doesn't work the way it's supposed to work. By passing an array to the postfields…
Deltanic
  • 1,009
  • 4
  • 11
  • 17
0
votes
1 answer

Bad type annotation. Unknown type

I keep getting the warning mentioned above but can't figure out why. I've added deps.js and deps.js contains a reference to the type. Here is the offending…
0
votes
2 answers

Eclipse code assist and closure compiler annotations

Sorry for removing the original question but will try to save you from having to read through a lot of things I've tried that don't work very well. Basically Eclipse with JSDT can't do the job. Tried to define all my namespaces with constructor…
HMR
  • 37,593
  • 24
  • 91
  • 160
0
votes
1 answer

Compile-time flags

I am using Google Closure Compiler. I am writing an app for web use and for use in a Chrome packaged app. 99% of the code is the same. There are a few differences when it comes to things like local storage. if(CHROME_APP) { ... } else { …
Paul Draper
  • 78,542
  • 46
  • 206
  • 285
0
votes
2 answers

Google closure compiler error "Variable COMPILED first declared in {SyntheticVarsDeclar}"

When using the Google closure compiler to try and compile a load of closure dependencies taken from their editor demo (no external code) using calcdeps.py I get the following error when then running the compiler on the produced code (which runs…
DEfusion
  • 5,533
  • 5
  • 44
  • 60
0
votes
1 answer

Compiling code + ydn with Closure Compiler

I'm trying to take advantage of Google Closure Compiler minification by writing a database script of my own and compiling it with the pre-compiled ydn. To get a basic first version working I'm trying to rewrite the todo list demo from the project. …
pwg
  • 11
0
votes
1 answer

How can I rewrite this so that Closure Compile renames my function?

I am compiling the following code with ADVANCED_OPTIMIZATIONS using Google Closure Compile : (function() { /** @const */ var DEBUG = false; var Namespace = {}; window['Namespace'] = Namespace; (function() { /** *…
Paul
  • 139,544
  • 27
  • 275
  • 264
0
votes
1 answer

Angularjs and Closure Compiler

I have this script in one of my controllers: function AdIssueListCtrl($scope, $http, $rootScope, $compile) { $rootScope.nav = { adsSideNav: true }; //datasource for kendoui interface $scope.kendo_adissues = new…
Ben Kilah
  • 3,445
  • 9
  • 44
  • 56
0
votes
1 answer

Sending compiled objects to Closure Templates

If I call a template from JavaScript with: namespace.template(record); where record is an instance of: /** @typedef {{var: string}} */ and I use the Google Closure Compiler in advanced mode, which rewrites var, then how can I receive var in the…
0
votes
1 answer

properties file for Closure-Compiler-ant-task

I am using closure compiler to minify javascript via the ant task. My build file is getting cluttered. Also, I am not minifying the javascript files in dev environment. Currently I am declaring the javascript files in two places. Once inside…
ShaggyInjun
  • 2,880
  • 2
  • 31
  • 52