How to link the Google Closure with one code?

38 views
Skip to first unread message

Dadsam Gamer

unread,
Jun 27, 2019, 6:21:27 PM6/27/19
to Closure Library Discuss
*How to link the Google Closure with one code? type <script src="closure-library/closure.js"> when load. the complete library of "goog" and others if have be loaded.
 Thanks for any help.

Steve Hicks

unread,
Jun 27, 2019, 6:28:21 PM6/27/19
to Closure Library Discuss
There are a number of ways to use Closure Library.  The preferred approach is to use it with Closure Compiler, but the built-in debug loader will also get the job done.  The documentation at https://google.github.io/closure-library/develop/get-started will get you jump-started with either approach (though do note that its explanation of the debug loader is a little oversimplified, based on goog.provide() rather than goog.module()).  In practice, to use modules you'll need to generate a deps.js file that includes your module and the parts of the Closure Library you use, and pull that into your HTML as well.

On Thu, Jun 27, 2019 at 3:21 PM Dadsam Gamer <dads...@gmail.com> wrote:
*How to link the Google Closure with one code? type <script src="closure-library/closure.js"> when load. the complete library of "goog" and others if have be loaded.
 Thanks for any help.

--

---
You received this message because you are subscribed to the Google Groups "Closure Library Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-library-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-library-discuss/1781adee-41e2-4d6a-b38c-4b340064d91a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dadsam Gamer

unread,
Jun 27, 2019, 9:53:53 PM6/27/19
to Closure Library Discuss
How can I get all goog. modules/libraries if I go to
 use them all? 

Stephen Hicks

unread,
Jun 27, 2019, 10:00:23 PM6/27/19
to Closure Library Discuss
The basic idea behind the debug loader is that it will load the files you need, based on a deps.js file.  You don't want to load all the files - there's literally hundreds of them.  And while you could conceivably bundle them all together into a single file, it would be huge and full of things you don't want.  So we don't really provide easy ways to do either of these.

The thing you want to do is use the debug loader and goog.require the Closure files.  If you have several JS files of your own you might look into the various tools for generating deps.js files and load that instead of the default.
Reply all
Reply to author
Forward
0 new messages