How to use buildbuilder to compile and reduce scripts

I am completely unfamiliar with the closing library and am starting to work. I just installed Python on my Windows 7 computer to combine and minimize scripts. I skipped some commands as described here , but without amplification. here are some options

  • Python is set to c:\python27\python.exe

  • Closing library in c:\closure\

  • Closure's compiler c:\closure\bin\build\compiler.jar

  • My javascript file in D:\projects\closureapp\js\index.js

the contents of index.js is equal to below

/// <reference path="../closure/base.js" />
/// <reference path="../closure/dom/dom.js" />


/*Hello world into Closure Library Example*/

//Load the dom module
goog.require("goog.dom");


//refer the document body
var pageBody = document.body;

//after the body is loaded execute and add a header
pageBody.onload = function () {

    //create a header for the page
    var pageHeader = goog.dom.createDom('h1', { 'style': 'background-color:#EEE' }, 'Hello world!');

    //append the header to the document body
    goog.dom.appendChild(pageBody, pageHeader);

};

I ran the below command to create compiled javascript but didn't get

c:\python27\python.exe c:\closure\bin\build\c
losurebuilder.py --root=closure/ --root=d:\Projects\closureapp\js\ --
output_mode=compiled  --compiler_jar=compiler.jar > d:\Projects\closureapp\js\output.js

I get some strange messages as below

c:\closure\bin\build\closurebuilder.py: Building dependency tree..
Traceback (most recent call last):
  File "c:\closure\bin\build\closurebuilder.py", line 257, in <module> main()
  File "c:\closure\bin\build\closurebuilder.py", line 204, in main tree = depstree.DepsTree(sources)
  File "c:\closure\bin\build\depstree.py", line 56, in __init__ raise NamespaceNotFoundError(require, source)
  depstree.NamespaceNotFoundError: Namespace "goog.async.Deferred" never provided.
  Required in Source closure\messaging\portchannel.js
+5
source share

All Articles