Including additional js in clojurescript compilation

57 views
Skip to first unread message

David Powell

unread,
Jul 30, 2011, 7:02:59 AM7/30/11
to clo...@googlegroups.com

The closure-template tools let you take a template, and pre-process it to something like:

hello3.soy.js:

goog.provide('example.templates');
goog.require('soy');
goog.require('soy.StringBuilder');
[...]
example.templates.welcome = function(opt_data, opt_sb) {
[...]


In my clojurescript, I can put:

(:require [example.templates :as temp])

...but when I compile the clojurescript with optimizations, I get an error from the closure compiler because it doesn't know where to find the example.templates.

Is there any way of specifying additional javascript files or paths for clojurescript to pass to the closure compiler?

-- 
Dave

Brenton

unread,
Jul 30, 2011, 2:11:12 PM7/30/11
to Clojure
Any Google Closure compliant JavaScript can be pulled into the build
process by using the :libs option.

For example:

(build src {:libs ["/foo/bar"]})

would include any JavaScript files under /foo/bar in the build
process.

Alen Ribic

unread,
Aug 2, 2011, 7:59:50 AM8/2/11
to Clojure
> Any Google Closure compliant JavaScript can be pulled into the build
> process by using the :libs option.

Is there any information/resource on what makes the Javascript library
Google Closure compliant?

I have a third-party library that I have included via {:libs []}
option, however it doesn't get included with any of the :optimizations
options.

Regards,
-Alen

On Jul 30, 8:11 pm, Brenton <bashw...@gmail.com> wrote:
> Any Google Closure compliant JavaScript can be pulled into the build
> process by using the :libs option.
>
> For example:
>
> (buildsrc{:libs ["/foo/bar"]})
>
> would include any JavaScript files under /foo/bar in the build
> process.
>
> On Jul 30, 7:02 am, David Powell <djpow...@djpowell.net> wrote:
>
>
>
>
>
>
>
> > The closure-template tools let you take a template, and pre-process it to
> > something like:
>
> > hello3.soy.js:
>
> > goog.provide('example.templates');
> > goog.require('soy');
> > goog.require('soy.StringBuilder');
> > [...]
> > example.templates.welcome = function(opt_data, opt_sb) {
> > [...]
>
> > In myclojurescript, I can put:
>
> > (:require [example.templates :as temp])
>
> > ...but when I compile theclojurescriptwith optimizations, I get an error
> > from the closure compiler because it doesn't know where to find the
> > example.templates.
>
> > Is there any way of specifying additional javascript files or paths for
> >clojurescriptto pass to the closure compiler?
>
> > --
> > Dave

Mark Rathwell

unread,
Aug 2, 2011, 9:59:34 AM8/2/11
to clo...@googlegroups.com

Some basic information and tips (start at page 5 or so on [1]):





>
> > --
> > Dave

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply all
Reply to author
Forward
0 new messages