RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

Make it possible to compile in simple mode jQuery-based app without inclusion Closure Library dependencies #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sample config:
 {
    "id": "project",
    "inputs" : "script.js", // just one script for simplicity (jQuery will be linked as external resource)
    "mode": "SIMPLE",
    "level": "VERBOSE",
    "externs" : "//jquery-1.6.js"
 }

With this config output is like this:
====================================
 var COMPILED=!0,goog=goog||{};goog.global=this;goog.DEBUG=!
 0;goog.LOCALE="en";goog.evalWorksForGlobals_=null;goog.provide=
 goog.setTestOnly=...
 goog.getObjectByName=...

 ... and the rest of Closure Library stuff

 function f(){ /* compiled code of my script.js */ }();
====================================

It would be great if plovr didn't by force include closure library in it's 
compile process.
Michael, as you proposed in email, it could be option in plovr config. Maybe 
boolean "compile-with-closure-library"?

Original issue reported on code.google.com by aleksam...@gmail.com on 11 Jun 2011 at 8:47

GoogleCodeExporter commented 8 years ago
FYI, I prefer to have boolean options be false by default, so 
"compile-with-closure-library" does not work as a name as I want that to be 
true by default. plovr is, after all, a _Closure_ build tool.

But yes, this option should exist to help support jQuery developers.

Original comment by bolinf...@gmail.com on 16 Jun 2011 at 9:36

GoogleCodeExporter commented 8 years ago
I have submitted a change to address this issue:

http://code.google.com/p/plovr/source/detail?r=49634d51cde2cdc74d21283fb332b9ae2
bcfbca4

As I am not a consumer of this feature, it would be helpful to get feedback 
from those of you who are.

Currently, you will have to build plovr from source to try this out. I would 
prefer to come to resolution on how this feature should be implemented before 
releasing a new plovr binary. Building from source is quite simple:

hg clone https://plovr.googlecode.com/hg/ plovr
cd plovr
ant jar

The binary will be in build/plovr.jar.

Original comment by bolinf...@gmail.com on 16 Jun 2011 at 10:36

GoogleCodeExporter commented 8 years ago

Original comment by bolinf...@gmail.com on 15 Sep 2011 at 2:03

GoogleCodeExporter commented 8 years ago
Looking at the code compiled I can't see any difference when using

    "experimental-exclude-closure-library": true, // No diff in advanced mode?

Does plovr by default remove goog in advanced mode when it does not find any 
references to it?

Original comment by lennart....@gmail.com on 18 Jan 2015 at 12:04