wenfeng.chen
wenfeng.chen

Reputation: 26

closure compile load module by demand

I just find

 java -jar Build\Tools\compiler.jar ^ 
--compilation_level=ADVANCED_OPTIMIZATIONS ^ 
--externs Build\jQuery.externs.js ^ 
--js Build\Output\Compiling.js ^ 
--js Script/Themes.lang.js ^ 
--js Script/Themes.js ^ 
--module Core:3 ^ 
--js UI/ThemeChooser/ThemeChooser_en.htm.js ^ 
--js UI/ThemeChooser/ThemeChooser.js ^ 
--module UI_ThemeChooser:2:Core ^ 
--js UI/VerticalTabs/VerticalTabs_en.htm.js ^ 
--js UI/VerticalTabs/VerticalTabs.js ^ 
--module UI_VerticalTabs:2:Core ^ 
--js Pager/Pager_en.htm.js ^ 
--js Pager/jquery.Pager.js ^ 
--js Pager/Pager.js ^ 
--module Pager:3:VerticalTabs ^ 
--module_output_path_prefix .\Compiled\

but I want to know how to set the --closure_entry_point and how to load moduled js by demand

Upvotes: 1

Views: 389

Answers (1)

John
John

Reputation: 5468

For your first question:

--closure_entry_point is used with --manage_closure_dependencies and --only_closure_dependencies to automatically trim files from the set pass to the compiler. If you aren't using these options they have no value.

For you second question:

You can load your module the same way you would load any other javascript. The simplest method is simply to append a script tag to the DOM when you want to load the module. Another method is to use an XHR to load the js and then call eval() with the results.

Upvotes: 1

Related Questions