I can't figure out how to get Plovr to just remove whitespace from a simple javascript file and not try to manage dependencies or scopes. (I don't want to use ADVANCED mode if I can help it because my needs for this file are extremely simple and I don't want to have to define externs to preserve every variable name.) I've combed through the Plovr documentation but I still can't figure out what I'm doing wrong.
hello.js:
alert("Hello world");
hello-config.js:
{
"id": "hello",
"mode": "WHITESPACE_ONLY",
"level": "QUIET",
"inputs": "./hello.js",
"output-file": "./hello-compiled.js"
}
When I run java -jar ./plovr.jar build hello-config.js
, the output in hello-compiled.js
is not one line as I'd expect. Instead it's 21 lines long with lots of stuff like this:
hello-compiled.js:
var COMPILED=!0,goog=goog||{};goog.NODE_JS=!1;goog.global=goog.NODE_JS?eval("global"):this;goog.DEBUG=!0;goog.LOCALE="en";
goog.addDependency=function(a,b,c){if(!COMPILED){for(var d,a=a.replace(/\\/g,"/")
goog.scope=function(a){a.call(goog.global)};
Config file
create another batch-file, plovr-serve and add following lines
Keep these two batch files and hello-config.js parallel to folder closure and closurecompiler
Then you are ready to go. Run the build and after that run the plovr-serve. Now open your application.html. Don't close the plovr-serve window.