As mentioned above, you will need an externs.js file with the signatures of the 
globals you need, or when compiled for production (with optimizations) the 
names will get mangled and will be unavailable.

Here's an example from a CLJS project that uses swfobject.js:

{:id           "sdk-prod"
                        :source-paths ["src/cljc" "src/cljs/dove/sdk"]
                        :compiler     {:output-to     
"public/js/gen/dov-e.1.0.min.js"
                                       :foreign-libs  [{:file     
"public/scripts/swfobject.js"
                                                        :provides 
["swfobject"]}]
                                       :externs ["public/scripts/externs.js"]
                                       :optimizations :advanced
                                       :pseudo-names  false
                                       :pretty-print  false}}

And the externs files looks like this:

var swfobject = function() {}
swfobject.embedSWF = function(a,b,c,d,e,f,g,h,i) {}
swfobject.createCSS = function(a,b) {}


Hope this helps.


On Saturday, November 28, 2015 at 9:27:39 PM UTC+2, Tom Purl wrote:
> > Do you have the js library included in your (SPA starter) html page 
> > (index.html/home.html) as mentioned at http://t4t5.github.io/sweetalert/:
> > 
> > <script src="dist/sweetalert.min.js"></script>
> > <link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
> > 
> > ?
> > 
> > It assumes that the sweetalert.min.js and css files are placed in 
> > resources/public/dist/....
> 
> That fixed it. Once I put the sweetalert js file above my baconbot_dot_js.js 
> file in index.html the (js/sweetAlert "Test!") code worked.
> 
> I guess I assumed that I just needed to add the css and js files to the cljs 
> file to take care of all of the dependencies. I didn't think of just 
> referencing things the "normal" way.
> 
> Thanks a bunch!
> 
> Tom Purl

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to